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