mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:00:43 +00:00
fix: remove unit from plan-driven IDs on removal
Ensure that when a unit is removed from the game, its ID is also deleted from the plan-driven unit IDs set
This commit is contained in:
@@ -893,6 +893,7 @@ export class GameImpl implements Game {
|
||||
}
|
||||
removeUnit(u: Unit) {
|
||||
this.unitGrid.removeUnit(u);
|
||||
this.planDrivenUnitIds.delete(u.id());
|
||||
if (u.hasTrainStation()) {
|
||||
this._railNetwork.removeStation(u);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user