bane mechanic thread finalized

This commit is contained in:
2024-12-31 18:23:03 -06:00
parent 22639baa4c
commit 93025b72cd
2 changed files with 27 additions and 14 deletions
+10 -10
View File
@@ -1012,7 +1012,7 @@ public class City extends AbstractWorldObject {
// Gather current list of players within the zone bounds
currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, CityBoundsType.ZONE.extents, MBServerStatics.MASK_PLAYER);
currentPlayers = WorldGrid.getObjectsInRangePartial(this.location, CityBoundsType.ZONE.extents * 2, MBServerStatics.MASK_PLAYER);
currentMemory = new HashSet<>();
for (AbstractWorldObject playerObject : currentPlayers) {
@@ -1061,20 +1061,20 @@ public class City extends AbstractWorldObject {
}
}
private void onExitBane(){
ArrayList<Integer> toRemove = new ArrayList<>();
for(int uuid : this.baneAttendees.keySet()){
if(!_playerMemory.contains(uuid)){
if(System.currentTimeMillis() - this.baneAttendees.get(uuid) > 180000){
toRemove.add(uuid);
private void onExitBane() {
Iterator<Integer> iterator = this.baneAttendees.keySet().iterator();
while (iterator.hasNext()) {
Integer uuid = iterator.next();
if (!_playerMemory.contains(uuid)) {
long timeGone = System.currentTimeMillis() - this.baneAttendees.get(uuid).longValue();
if (timeGone > 180000) { // 3 minutes
iterator.remove();
}
}
}
for(Integer uuid : toRemove){
this.baneAttendees.remove(uuid);
}
}
private void onExit(HashSet<Integer> currentMemory) {
PlayerCharacter player;