fix: Prevent false occupancy detection in quick teleport w wireds

This commit is contained in:
brenoepic 2024-05-15 02:13:14 +00:00
parent 112e1ff377
commit eb2ecd7132

View File

@ -206,7 +206,10 @@ public class RoomTile {
public boolean hasUnits() {
synchronized(this.units) {
return this.units.size() > 0;
if (!this.units.isEmpty()) {
this.units.removeIf(unit -> !unit.getCurrentLocation().equals(this));
}
return !this.units.isEmpty();
}
}