Browse Source

mob desync issue

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

4
src/engine/objects/Corpse.java

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

3
src/engine/objects/Mob.java

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

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

@ -247,6 +247,8 @@ public class WorldServer { @@ -247,6 +247,8 @@ public class WorldServer {
nextWareHousePushTime = LocalDateTime.now().plusMinutes(15);
}
if(LocalDateTime.now().isAfter(nextDiscSpawn)) {
switch (LocalDateTime.now().getHour()) {
case 0:
case 4:
@ -262,6 +264,8 @@ public class WorldServer { @@ -262,6 +264,8 @@ public class WorldServer {
break;
}
nextDiscSpawn = nextDiscSpawn.plusHours(1);
}
ThreadUtils.sleep(50);
}
}

Loading…
Cancel
Save