Use of canInteract for NPC onBypassFeedback method.

This commit is contained in:
MobiusDev
2019-01-02 21:45:20 +00:00
parent 3ccdb2eb84
commit 088f57bc41
12 changed files with 33 additions and 20 deletions

View File

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