Use of canInteract for NPC onBypassFeedback method.
This commit is contained in:
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
@ -701,13 +701,30 @@ public class L2NpcInstance extends L2Character
|
||||
*/
|
||||
protected boolean canInteract(L2PcInstance player)
|
||||
{
|
||||
// TODO: NPC busy check etc...
|
||||
|
||||
if (!isInsideRadius(player, INTERACTION_DISTANCE, false, false))
|
||||
if (player.isCastingNow())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isDead() || player.isFakeDeath())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isSitting())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.isInStoreMode())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!isInsideRadius(player, INTERACTION_DISTANCE, false, false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (player.getInstanceId() != getInstanceId())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -559,11 +559,7 @@ public class L2Npc extends L2Character
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if ((player.getInstanceId() != getInstanceId()) && (player.getInstanceId() != -1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (_isBusy)
|
||||
else if (player.getInstanceId() != getInstanceId())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -707,7 +703,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
if (_isBusy && (_busyMessage.length() > 0))
|
||||
{
|
||||
|
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
@ -622,7 +622,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void onBypassFeedback(L2PcInstance player, String command)
|
||||
{
|
||||
// if (canInteract(player))
|
||||
if (canInteract(player))
|
||||
{
|
||||
final IBypassHandler handler = BypassHandler.getInstance().getHandler(command);
|
||||
if (handler != null)
|
||||
|
Reference in New Issue
Block a user