Code improvements.
This commit is contained in:
@@ -50,14 +50,11 @@ public class L2ArtefactInstanceAction implements IActionHandler
|
||||
{
|
||||
activeChar.setTarget(target);
|
||||
}
|
||||
else if (interact)
|
||||
// Calculate the distance between the L2PcInstance and the L2NpcInstance
|
||||
else if (interact && !((L2Npc) target).canInteract(activeChar))
|
||||
{
|
||||
// Calculate the distance between the L2PcInstance and the L2NpcInstance
|
||||
if (!((L2Npc) target).canInteract(activeChar))
|
||||
{
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
|
||||
}
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, target);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@@ -22,7 +22,6 @@ import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.L2Npc;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.entity.L2Event;
|
||||
@@ -88,8 +87,7 @@ public class L2NpcAction implements IActionHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, target);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, target));
|
||||
}
|
||||
}
|
||||
else if (!target.isAutoAttackable(activeChar))
|
||||
|
@@ -22,7 +22,6 @@ import com.l2jmobius.gameserver.enums.InstanceType;
|
||||
import com.l2jmobius.gameserver.enums.PrivateStoreType;
|
||||
import com.l2jmobius.gameserver.handler.IActionHandler;
|
||||
import com.l2jmobius.gameserver.model.L2Object;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.entity.TvTEvent;
|
||||
import com.l2jmobius.gameserver.network.SystemMessageId;
|
||||
@@ -108,8 +107,7 @@ public class L2PcInstanceAction implements IActionHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
|
||||
}
|
||||
activeChar.onActionRequest();
|
||||
}
|
||||
@@ -124,8 +122,7 @@ public class L2PcInstanceAction implements IActionHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
final Location destination = GeoData.getInstance().moveCheck(activeChar, player);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, destination);
|
||||
activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, GeoData.getInstance().moveCheck(activeChar, player));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
|
||||
public class L2StaticObjectInstanceAction implements IActionHandler
|
||||
{
|
||||
@Override
|
||||
public boolean action(L2PcInstance activeChar, final L2Object target, final boolean interact)
|
||||
public boolean action(L2PcInstance activeChar, L2Object target, boolean interact)
|
||||
{
|
||||
final L2StaticObjectInstance staticObject = (L2StaticObjectInstance) target;
|
||||
if (staticObject.getType() < 0)
|
||||
|
Reference in New Issue
Block a user