🆙 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

@ -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();
}
}