Sundae2608 / BattleSimulation

Battle Simulation mimicking the mechanics of the Total War series
1 stars 0 forks source link

Software crashes when one unit goes out of existence. #70

Closed Sundae2608 closed 4 years ago

Sundae2608 commented 4 years ago

Every time a unit dies, the software will immediately crashes. This probably have to do with the main list of units being checked for collision, vision and other factors. This main list of units never changes even though one of the units dies.

We maintain the current list of units mainly for drawing purpose. But a more elegant solution would be to have a set of aliveUnits. And only aliveUnits will participate in battle processing.

Sundae2608 commented 4 years ago

This has been fixed with recent pushes. The software now runs correctly when a unit dies.