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.
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.