Resolve "Rework NumDefendersCalc"

Closes #1727 and #1718

See merge request main/Sumatra!1495

sumatra-commit: cf6667f0d167a1049c51ea910562d4248c941b82
2 jobs for master in 4 minutes and 48 seconds (queued for 3 seconds)