瀏覽代碼

little tweak

janiii 15 年之前
父節點
當前提交
57017b6fb8

+ 10 - 10
L2_GameServer/java/com/l2jserver/gameserver/RecipeController.java

@@ -67,7 +67,7 @@ public class RecipeController
 	protected static final Logger _log = Logger.getLogger(RecipeController.class.getName());
 	
 	private Map<Integer, L2RecipeList> _lists;
-	protected static final Map<L2PcInstance, RecipeItemMaker> _activeMakers = Collections.synchronizedMap(new WeakHashMap<L2PcInstance, RecipeItemMaker>());
+	protected static final Map<Integer, RecipeItemMaker> _activeMakers = Collections.synchronizedMap(new WeakHashMap<Integer, RecipeItemMaker>());
 	private static final String RECIPES_FILE = "recipes.xml";
 	
 	public static RecipeController getInstance()
@@ -125,7 +125,7 @@ public class RecipeController
 	{
 		RecipeItemMaker maker = null;
 		if (Config.ALT_GAME_CREATION)
-			maker = _activeMakers.get(player);
+			maker = _activeMakers.get(player.getObjectId());
 		
 		if (maker == null)
 		{
@@ -140,7 +140,7 @@ public class RecipeController
 	
 	public synchronized void requestMakeItemAbort(L2PcInstance player)
 	{
-		_activeMakers.remove(player); // TODO:  anything else here?
+		_activeMakers.remove(player.getObjectId()); // TODO:  anything else here?
 	}
 	
 	public synchronized void requestManufactureItem(L2PcInstance manufacturer, int recipeListId, L2PcInstance player)
@@ -162,7 +162,7 @@ public class RecipeController
 		
 		RecipeItemMaker maker;
 		
-		if (Config.ALT_GAME_CREATION && (maker = _activeMakers.get(manufacturer)) != null) // check if busy
+		if (Config.ALT_GAME_CREATION && (maker = _activeMakers.get(manufacturer.getObjectId())) != null) // check if busy
 		{
 			player.sendMessage("Manufacturer is busy, please try later.");
 			return;
@@ -173,7 +173,7 @@ public class RecipeController
 		{
 			if (Config.ALT_GAME_CREATION)
 			{
-				_activeMakers.put(manufacturer, maker);
+				_activeMakers.put(manufacturer.getObjectId(), maker);
 				ThreadPoolManager.getInstance().scheduleGeneral(maker, 100);
 			}
 			else
@@ -207,7 +207,7 @@ public class RecipeController
 		RecipeItemMaker maker;
 		
 		// check if already busy (possible in alt mode only)
-		if (Config.ALT_GAME_CREATION && ((maker = _activeMakers.get(player)) != null))
+		if (Config.ALT_GAME_CREATION && ((maker = _activeMakers.get(player.getObjectId())) != null))
 		{
 			SystemMessage sm = new SystemMessage(SystemMessageId.S2_S1);
 			sm.addItemName(recipeList.getItemId());
@@ -221,7 +221,7 @@ public class RecipeController
 		{
 			if (Config.ALT_GAME_CREATION)
 			{
-				_activeMakers.put(player, maker);
+				_activeMakers.put(player.getObjectId(), maker);
 				ThreadPoolManager.getInstance().scheduleGeneral(maker, 100);
 			}
 			else
@@ -535,7 +535,7 @@ public class RecipeController
 				return;
 			}
 			
-			if (Config.ALT_GAME_CREATION && _activeMakers.get(_player) == null)
+			if (Config.ALT_GAME_CREATION && _activeMakers.get(_player.getObjectId()) == null)
 			{
 				if (_target != _player)
 				{
@@ -647,7 +647,7 @@ public class RecipeController
 			// update load and mana bar of craft window
 			updateCurMp();
 			updateCurLoad();
-			_activeMakers.remove(_player);
+			_activeMakers.remove(_player.getObjectId());
 			_player.isInCraftMode(false);
 			_target.sendPacket(new ItemList(_target, false));
 		}
@@ -845,7 +845,7 @@ public class RecipeController
 		{
 			updateMakeInfo(false);
 			_player.isInCraftMode(false);
-			_activeMakers.remove(_player);
+			_activeMakers.remove(_player.getObjectId());
 		}
 		
 		/**

+ 5 - 5
L2_GameServer/java/com/l2jserver/gameserver/SevenSignsFestival.java

@@ -2052,13 +2052,13 @@ public class SevenSignsFestival implements SpawnListener
 		List<L2FestivalMonsterInstance> _npcInsts;
 		
 		private List<L2PcInstance> _participants;
-		private Map<L2PcInstance, FestivalSpawn> _originalLocations;
+		private Map<Integer, FestivalSpawn> _originalLocations;
 		
 		protected L2DarknessFestival(int cabal, int levelRange)
 		{
 			_cabal = cabal;
 			_levelRange = levelRange;
-			_originalLocations = new FastMap<L2PcInstance, FestivalSpawn>();
+			_originalLocations = new FastMap<Integer, FestivalSpawn>();
 			_npcInsts = new FastList<L2FestivalMonsterInstance>();
 			
 			if (cabal == SevenSigns.CABAL_DAWN)
@@ -2096,7 +2096,7 @@ public class SevenSignsFestival implements SpawnListener
 				{
 					for (L2PcInstance participant : _participants)
 					{
-						_originalLocations.put(participant, new FestivalSpawn(participant.getX(), participant.getY(), participant.getZ(), participant.getHeading()));
+						_originalLocations.put(participant.getObjectId(), new FestivalSpawn(participant.getX(), participant.getY(), participant.getZ(), participant.getHeading()));
 						
 						// Randomize the spawn point around the specific centerpoint for each player.
 						int x = _startLocation._x;
@@ -2400,10 +2400,10 @@ public class SevenSignsFestival implements SpawnListener
 		{
 			try
 			{
-				FestivalSpawn origPosition = _originalLocations.get(participant);
+				FestivalSpawn origPosition = _originalLocations.get(participant.getObjectId());
 				
 				if (isRemoving)
-					_originalLocations.remove(participant);
+					_originalLocations.remove(participant.getObjectId());
 				
 				participant.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
 				participant.teleToLocation(origPosition._x, origPosition._y, origPosition._z, true);

+ 4 - 4
L2_GameServer/java/com/l2jserver/gameserver/model/actor/L2Attackable.java

@@ -305,7 +305,7 @@ public class L2Attackable extends L2Npc
 
 	private boolean _absorbed;
 
-	private FastMap<L2PcInstance, AbsorberInfo> _absorbersList = new FastMap<L2PcInstance, AbsorberInfo>().shared();
+	private FastMap<Integer, AbsorberInfo> _absorbersList = new FastMap<Integer, AbsorberInfo>().shared();
 
 	private boolean _mustGiveExpSp;
 
@@ -2024,13 +2024,13 @@ public class L2Attackable extends L2Npc
 			return;
 
 		// If we have no _absorbersList initiated, do it
-		AbsorberInfo ai = _absorbersList.get(attacker);
+		AbsorberInfo ai = _absorbersList.get(attacker.getObjectId());
 
 		// If the L2Character attacker isn't already in the _absorbersList of this L2Attackable, add it
 		if (ai == null)
 		{
 			ai = new AbsorberInfo(attacker, crystalId, getCurrentHp());
-			_absorbersList.put(attacker, ai);
+			_absorbersList.put(attacker.getObjectId(), ai);
 		}
 		else
 		{
@@ -2090,7 +2090,7 @@ public class L2Attackable extends L2Npc
 			}
 
 			// Fail if the killer isn't in the _absorbersList of this L2Attackable and mob is not boss
-			AbsorberInfo ai = _absorbersList.get(killer);
+			AbsorberInfo ai = _absorbersList.get(killer.getObjectId());
 			if (ai == null || ai._absorber.getObjectId() != killer.getObjectId())
 				isSuccess = false;