1dot13 / source

Source code for the game executable of the Jagged Alliance 2 v1.13 project
85 stars 17 forks source link

Call RemovePlayerFromGroup instead of RemoveGroup #260

Closed Asdow closed 5 months ago

Asdow commented 5 months ago

There was a bug in a provided save where a merc's group had persistent flag set, even though the assignment was DRILL_MILITIA, which should never have a persistent group. When the code was calling RemoveGroup() instead of RemovePlayerFromGroup() at this point, it would crash the game with an assertion error in CancelEmptyPersistentGroupMovement() as the group in fact was not empty! Now we're removing the merc first and then checking if the group is empty and if so, attempt to delete it.