Browse Source

Fixing Fort Envoys

GodKratos 16 years ago
parent
commit
0f8436248d

+ 0 - 7
L2_GameServer/java/net/sf/l2j/gameserver/instancemanager/FortManager.java

@@ -20,7 +20,6 @@ import java.util.List;
 import java.util.logging.Logger;
 
 import javolution.util.FastList;
-import javolution.util.FastMap;
 import net.sf.l2j.L2DatabaseFactory;
 import net.sf.l2j.gameserver.model.L2Clan;
 import net.sf.l2j.gameserver.model.L2Object;
@@ -31,7 +30,6 @@ public class FortManager
 	protected static final Logger _log = Logger.getLogger(FortManager.class.getName());
 	// =========================================================
 	private static FortManager _instance;
-	public FastMap<Integer, Integer> _envoyCastles = new FastMap<Integer, Integer>();
 	
 	public static final FortManager getInstance()
     {
@@ -203,9 +201,4 @@ public class FortManager
         if (_forts == null) _forts = new FastList<Fort>();
         return _forts;
     }
-    
-	public int getEnvoyCastle(int npcId)
-	{
-		return _envoyCastles.get(npcId);
-	}
 }

+ 6 - 4
L2_GameServer/java/net/sf/l2j/gameserver/model/entity/Fort.java

@@ -76,7 +76,9 @@ public class Fort
 	protected FastList<L2Spawn> _siegeNpcs = new FastList<L2Spawn>();
 	protected FastList<L2Spawn> _npcCommanders = new FastList<L2Spawn>();
 	protected FastList<L2Spawn> _specialEnvoys = new FastList<L2Spawn>();
-	
+
+	private FastMap<Integer, Integer> _envoyCastles = new FastMap<Integer, Integer>();
+
 	/** Fortress Functions */
 	public static final int FUNC_TELEPORT = 1;
 	public static final int FUNC_RESTORE_HP = 2;
@@ -1099,7 +1101,7 @@ public class Fort
 
 	public final int getCastleIdFromEnvoy(int npcId)
 	{
-		return FortManager.getInstance().getEnvoyCastle(npcId);
+		return _envoyCastles.get(npcId);
 	}
 	/**
 	 * @return Returns amount of barracks.
@@ -1364,7 +1366,7 @@ public class Fort
     {
     	Connection con = null;
     	_specialEnvoys.clear();
-    	FortManager.getInstance()._envoyCastles.clear();
+    	_envoyCastles.clear();
     	try
 		{
 			con = L2DatabaseFactory.getInstance().getConnection();
@@ -1390,7 +1392,7 @@ public class Fort
 					spawnDat.setHeading(rset.getInt("heading"));
 					spawnDat.setRespawnDelay(60);
 					_specialEnvoys.add(spawnDat);
-					FortManager.getInstance()._envoyCastles.put(npcId, castleId);
+					_envoyCastles.put(npcId, castleId);
 				}
 				else
 				{