relog crash bug

This commit is contained in:
2025-02-27 19:16:37 -06:00
parent 140ba6ae75
commit 80b1ab709d
2 changed files with 21 additions and 3 deletions
@@ -511,6 +511,18 @@ public enum InterestManager implements Runnable {
if (player == null) if (player == null)
return; return;
for(PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()){
if(pc.equals(player)){
try{
WorldGrid.RemoveWorldObject(player);
}catch(Exception e){
}
}
}
ClientConnection origin = player.getClientConnection(); ClientConnection origin = player.getClientConnection();
if (origin == null) if (origin == null)
+9 -3
View File
@@ -976,8 +976,8 @@ public class MobAI {
if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal()) if (mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardCaptain.ordinal())
CheckForPlayerGuardAggro(mob); CheckForPlayerGuardAggro(mob);
} else { } else {
//CheckForAggro(mob); if(mob.combatTarget == null)
NewAggroMechanic(mob); NewAggroMechanic(mob);
} }
} }
@@ -1416,10 +1416,16 @@ public class MobAI {
public static void NewAggroMechanic(Mob mob){ public static void NewAggroMechanic(Mob mob){
if(mob == null || !mob.isAlive()){ if(mob == null || !mob.isAlive() || mob.playerAgroMap.isEmpty()){
return; return;
} }
if(mob.hate_values == null)
mob.hate_values = new HashMap<>();
if(mob.combatTarget != null)
return;
HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(mob.loc,60.0f,MBServerStatics.MASK_PLAYER); HashSet<AbstractWorldObject> inRange = WorldGrid.getObjectsInRangePartial(mob.loc,60.0f,MBServerStatics.MASK_PLAYER);
if(inRange.isEmpty()){ if(inRange.isEmpty()){