Преглед на файлове

Sanity check, preventing spawn of the multiple mobs in the same time if decreaseCount() called multiple times from AI.

_DS_ преди 16 години
родител
ревизия
fb8bc6ba55
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      L2_GameServer/java/net/sf/l2j/gameserver/model/L2Spawn.java

+ 4 - 0
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Spawn.java

@@ -360,6 +360,10 @@ public class L2Spawn
 	 */
 	public void decreaseCount(/*int npcId*/L2Npc oldNpc)
 	{
+		// sanity check
+		if (_currentCount <= 0)
+			return;
+
 		// Decrease the current number of L2NpcInstance of this L2Spawn
 		_currentCount--;