Преглед изворни кода

BETA: Fixed a bug where summons could not attack when player was in combat.
* Fixed some forgotten time unit changes related to attack end time since [6546].
* Patch by: FBIagent

Reviewed by: FBIagent
Reported by: Sdw, u3games

Nos пре 11 година
родитељ
комит
dc00f762c2

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Character.java

@@ -4066,7 +4066,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
 	/**
 	 * @return True if the L2Character is attacking.
 	 */
-	public boolean isAttackingNow()
+	public final boolean isAttackingNow()
 	{
 		return _attackEndTime > System.currentTimeMillis();
 	}

+ 1 - 8
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/L2Summon.java

@@ -19,7 +19,6 @@
 package com.l2jserver.gameserver.model.actor;
 
 import com.l2jserver.Config;
-import com.l2jserver.gameserver.GameTimeController;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.ai.L2CharacterAI;
 import com.l2jserver.gameserver.ai.L2SummonAI;
@@ -940,12 +939,6 @@ public abstract class L2Summon extends L2Playable
 		return false;
 	}
 	
-	@Override
-	public final boolean isAttackingNow()
-	{
-		return isInCombat();
-	}
-	
 	public int getWeapon()
 	{
 		return 0;
@@ -1065,7 +1058,7 @@ public abstract class L2Summon extends L2Playable
 		
 		if (isAttackingDisabled())
 		{
-			if (getAttackEndTime() <= GameTimeController.getInstance().getGameTicks())
+			if (!isAttackingNow())
 			{
 				return false;
 			}

+ 2 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/UseItem.java

@@ -21,12 +21,10 @@ package com.l2jserver.gameserver.network.clientpackets;
 import java.util.logging.Level;
 
 import com.l2jserver.Config;
-import com.l2jserver.gameserver.GameTimeController;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.ai.CtrlEvent;
 import com.l2jserver.gameserver.ai.CtrlIntention;
 import com.l2jserver.gameserver.ai.NextAction;
-import com.l2jserver.gameserver.ai.NextAction.NextActionCallback;
 import com.l2jserver.gameserver.enums.PcRace;
 import com.l2jserver.gameserver.enums.PrivateStoreType;
 import com.l2jserver.gameserver.handler.IItemHandler;
@@ -316,14 +314,14 @@ public final class UseItem extends L2GameClientPacket
 			if (activeChar.isCastingNow() || activeChar.isCastingSimultaneouslyNow())
 			{
 				// Creating next action class.
-				final NextAction nextAction = new NextAction(CtrlEvent.EVT_FINISH_CASTING, CtrlIntention.AI_INTENTION_CAST, (NextActionCallback) () -> activeChar.useEquippableItem(item, true));
+				final NextAction nextAction = new NextAction(CtrlEvent.EVT_FINISH_CASTING, CtrlIntention.AI_INTENTION_CAST, () -> activeChar.useEquippableItem(item, true));
 				
 				// Binding next action to AI.
 				activeChar.getAI().setNextAction(nextAction);
 			}
 			else if (activeChar.isAttackingNow())
 			{
-				ThreadPoolManager.getInstance().scheduleGeneral(new WeaponEquipTask(item, activeChar), (activeChar.getAttackEndTime() - GameTimeController.getInstance().getGameTicks()) * GameTimeController.MILLIS_IN_TICK);
+				ThreadPoolManager.getInstance().scheduleGeneral(new WeaponEquipTask(item, activeChar), activeChar.getAttackEndTime() - System.currentTimeMillis());
 			}
 			else
 			{