Skip to content

Call RemovePlayerFromGroup instead of RemoveGroup - #260

Merged
Asdow merged 1 commit into
masterfrom
bugfix
Jan 2, 2024
Merged

Call RemovePlayerFromGroup instead of RemoveGroup#260
Asdow merged 1 commit into
masterfrom
bugfix

Conversation

@Asdow

@Asdow Asdow commented Jan 2, 2024

Copy link
Copy Markdown
Contributor

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.

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.
@Asdow
Asdow merged commit 57bf3d9 into master Jan 2, 2024
@Asdow
Asdow deleted the bugfix branch January 2, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant