瀏覽代碼

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--;