Przeglądaj źródła

some NPE pixies.

JIV 15 lat temu
rodzic
commit
43664c39aa

+ 5 - 6
L2_GameServer/java/com/l2jserver/gameserver/instancemanager/FourSepulchersManager.java

@@ -1442,14 +1442,15 @@ public class FourSepulchersManager
 	
 	public void deleteAllMobs()
 	{
-		// _log.info("FourSepulchersManager.DeleteAllMobs: Try to delete " +
-		// _allMobs.size() + " monsters.");
-		
 		for (L2Npc mob : _allMobs)
 		{
+			if (mob == null)
+				continue;
+			
 			try
 			{
-				mob.getSpawn().stopRespawn();
+				if (mob.getSpawn() != null)
+					mob.getSpawn().stopRespawn();
 				mob.deleteMe();
 			}
 			catch (Exception e)
@@ -1458,8 +1459,6 @@ public class FourSepulchersManager
 			}
 		}
 		_allMobs.clear();
-		// _log.info("FourSepulchersManager.DeleteAllMobs: Deleted " + delCnt +
-		// " monsters.");
 	}
 	
 	protected void closeAllDoors()

+ 11 - 1
L2_GameServer/java/com/l2jserver/gameserver/model/L2Clan.java

@@ -1432,12 +1432,22 @@ public class L2Clan
 	
 	public boolean isAtWarWith(Integer id)
 	{
-		if (_atWarWith != null && !_atWarWith.isEmpty())
+		if (!_atWarWith.isEmpty())
 			if (_atWarWith.contains(id))
 				return true;
 		return false;
 	}
 	
+	public boolean isAtWarWith(L2Clan clan)
+	{
+		if (clan == null)
+			return false;
+		if (!_atWarWith.isEmpty())
+			if (_atWarWith.contains(clan.getClanId()))
+				return true;
+		return false;
+	}
+	
 	public boolean isAtWarAttacker(Integer id)
 	{
 		if (_atWarAttackers != null && !_atWarAttackers.isEmpty())

+ 10 - 7
L2_GameServer/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -12926,18 +12926,21 @@ public final class L2PcInstance extends L2Playable
         stopSoulTask();
         sendPacket(new EtcStatusUpdate(this));
     }
-
+    
     /**
      * Starts/Restarts the SoulTask to Clear Souls after 10 Mins.
      */
     private void restartSoulTask()
     {
-        if (_soulTask != null)
-        {
-            _soulTask.cancel(false);
-            _soulTask = null;
-        }
-        _soulTask = ThreadPoolManager.getInstance().scheduleGeneral(new SoulTask(this), 600000);
+    	synchronized(this)
+    	{
+    		if (_soulTask != null)
+    		{
+    			_soulTask.cancel(false);
+    			_soulTask = null;
+    		}
+    		_soulTask = ThreadPoolManager.getInstance().scheduleGeneral(new SoulTask(this), 600000);
+    	}
     }
 
     /**

+ 4 - 1
L2_GameServer/java/com/l2jserver/gameserver/skills/conditions/ConditionMinDistance.java

@@ -39,7 +39,10 @@ public class ConditionMinDistance extends Condition
 	 * @see com.l2jserver.gameserver.skills.conditions.Condition#testImpl(com.l2jserver.gameserver.skills.Env)
 	 */
 	@Override
-	public boolean testImpl(Env env) {
+	public boolean testImpl(Env env) 
+	{
+		if (env.target == null) 
+			return false;
 		return env.player.getDistanceSq(env.target) >= _sqDistance;
 	}
 }