relog crash bug
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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()){
|
||||||
|
|||||||
Reference in New Issue
Block a user