🛠️ Improvements:
Melee units always tried to attack the nearest gate, even if it wasn’t actually reachable. This caused units in some castles to wander back and forth as they attempted to navigate to a gate they couldn’t reach. This issue still occurs occasionally, but much less frequently now.
Performance improvements during attacks: The system now first checks the distance from all buildings to the unit, and only then determines which attack point is closest. Previously, all attack points were checked individually, which was theoretically more precise but could result in thousands of checks per cycle in larger castles. This change saves significant computation.
🐞 Bugfixes:
There was a timing issue when removing dead units after a battle, causing the removal to be attempted twice and leading to an exception.
Defending units had stopped attacking.
⚖️ Balancing:
Gates now break significantly faster.
