Browse Source

mob desync issue

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
f865f94806
  1. 6
      src/engine/objects/Corpse.java
  2. 3
      src/engine/objects/Mob.java
  3. 28
      src/engine/server/world/WorldServer.java

6
src/engine/objects/Corpse.java

@ -63,10 +63,8 @@ public class Corpse extends AbstractWorldObject {
this.inBuilding = belongsTo.getInBuilding(); this.inBuilding = belongsTo.getInBuilding();
this.inFloorID = belongsTo.getInFloorID(); this.inFloorID = belongsTo.getInFloorID();
this.inBuildingID = belongsTo.getInBuildingID(); this.inBuildingID = belongsTo.getInBuildingID();
if(belongsTo.isMoving()) belongsTo.stopMovement(belongsTo.getMovementLoc());
this.setLoc(belongsTo.getMovementLoc()); this.setLoc(belongsTo.getMovementLoc());
else
this.setLoc(belongsTo.getLoc());
} else { } else {
Logger.error("No player passed in for corpse"); Logger.error("No player passed in for corpse");
this.firstName = ""; this.firstName = "";

3
src/engine/objects/Mob.java

@ -858,6 +858,9 @@ public class Mob extends AbstractIntelligenceAgent {
public void updateLocation() { public void updateLocation() {
if(true)
return;
if (!this.isMoving()) if (!this.isMoving())
return; return;

28
src/engine/server/world/WorldServer.java

@ -247,20 +247,24 @@ public class WorldServer {
nextWareHousePushTime = LocalDateTime.now().plusMinutes(15); nextWareHousePushTime = LocalDateTime.now().plusMinutes(15);
} }
switch(LocalDateTime.now().getHour()){
case 0: if(LocalDateTime.now().isAfter(nextDiscSpawn)) {
case 4: switch (LocalDateTime.now().getHour()) {
case 8: case 0:
case 12: case 4:
case 16: case 8:
case 20: case 12:
for(Mob dropper : Mob.disciplineDroppers) { case 16:
if (!dropper.isAlive()) { case 20:
Zone.respawnQue.add(dropper); for (Mob dropper : Mob.disciplineDroppers) {
if (!dropper.isAlive()) {
Zone.respawnQue.add(dropper);
}
} }
} break;
break;
}
nextDiscSpawn = nextDiscSpawn.plusHours(1);
} }
ThreadUtils.sleep(50); ThreadUtils.sleep(50);
} }

Loading…
Cancel
Save