Units that don't have enemies shouldn't be in the battle.  Fixed a bug where there could be no defenders and catapults could get bonus when they shouldn't