🆙 Prevent false occupancy detection in quick teleport w wireds

Fix by brenoepic
This commit is contained in:
duckietm 2024-05-15 08:49:20 +02:00
parent d825006c33
commit f042e0feff
2 changed files with 5 additions and 2 deletions

View File

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