Просмотр исходного кода

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

_DS_ 16 лет назад
Родитель
Сommit
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--;