mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 16:30:16 +00:00
bugfix: remove unit before updating tile in UnitImpl.move(). This is because if a unit moves too fast or on border, UnitGrid will not find the existing unit, causing duplicate units
This commit is contained in:
@@ -88,9 +88,9 @@ export class UnitImpl implements Unit {
|
||||
if (tile == null) {
|
||||
throw new Error("tile cannot be null");
|
||||
}
|
||||
this.mg.removeUnit(this);
|
||||
this._lastTile = this._tile;
|
||||
this._tile = tile;
|
||||
this.mg.removeUnit(this);
|
||||
this.mg.addUnit(this);
|
||||
this.mg.addUpdate(this.toUpdate());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user