Improved checkIfPvP method.

This commit is contained in:
MobiusDev
2018-04-12 16:30:25 +00:00
parent 7c9ca42499
commit 198f42c0a7
14 changed files with 47 additions and 118 deletions

View File

@ -203,20 +203,12 @@ public abstract class L2Playable extends L2Character
{
final L2PcInstance player = getActingPlayer();
if ((player == null) || (target == null) || (player == target))
{
return true;
}
if (target.isOnDarkSide())
{
return true;
}
else if (target.getReputation() < 0)
{
return true;
}
else if ((player.getPvpFlag() > 0) && (target.getPvpFlag() > 0))
if ((player == null) //
|| (target == null) //
|| (player == target) //
|| (target.getReputation() < 0) //
|| (target.getPvpFlag() > 0) //
|| target.isOnDarkSide())
{
return true;
}

View File

@ -5302,11 +5302,10 @@ public final class L2PcInstance extends L2Playable
return;
}
if ((isInDuel() && (player_target.getDuelId() == getDuelId())))
if (isInDuel() && (player_target.getDuelId() == getDuelId()))
{
return;
}
if ((!isInsideZone(ZoneId.PVP) || !player_target.isInsideZone(ZoneId.PVP)) && (player_target.getReputation() >= 0))
{
if (checkIfPvP(player_target))
@ -5317,7 +5316,6 @@ public final class L2PcInstance extends L2Playable
{
setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_NORMAL_TIME);
}
if (getPvpFlag() == 0)
{
startPvPFlag();