Selaa lähdekoodia

BETA: Fixed the problems caused by my last commits. This time I've tested it and its working, sorry for commiting untested stuff even if it looks like it should work.

Nik 13 vuotta sitten
vanhempi
sitoutus
0cd98e1d97

+ 6 - 13
L2J_Server_BETA/java/com/l2jserver/gameserver/GameTimeController.java

@@ -14,8 +14,6 @@
  */
 package com.l2jserver.gameserver;
 
-import gnu.trove.TObjectProcedure;
-
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -113,20 +111,15 @@ public class GameTimeController
 	protected void moveObjects()
 	{
 		// Go throw the table containing L2Character in movement
-		_movingObjects.forEachValue(new MoveObjects());
-	}
-	
-	private final class MoveObjects implements TObjectProcedure<L2Character>
-	{	
-		@Override
-		public final boolean execute(final L2Character ch)
+		for (Object obj : _movingObjects.getValues())
 		{
-			if (ch.updatePosition(_gameTicks))
+			// If movement is finished, the L2Character is removed from
+			// movingObjects and added to the ArrayList ended
+			if (((L2Character) obj).updatePosition(_gameTicks))
 			{
-				ThreadPoolManager.getInstance().executeTask(new MovingObjectArrived(ch));
-				_movingObjects.remove(ch.getObjectId());
+				_movingObjects.remove(((L2Character) obj).getObjectId());
+				ThreadPoolManager.getInstance().executeTask(new MovingObjectArrived(((L2Character) obj)));
 			}
-			return true;
 		}
 	}