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

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