IdleNotifier: change isAttackable to support deadman mode (#2144)

* change isAttackable to support deadman mode, where anyone from lvl 3 - 126 is attackable
This commit is contained in:
Michael
2019-12-20 04:59:50 -05:00
committed by Kyle
parent 006900d1b5
commit 2af5ecb6ac

View File

@@ -55,10 +55,19 @@ public class PvPUtil
public static boolean isAttackable(Client client, Player player)
{
int wildernessLevel = 0;
if (!(client.getVar(Varbits.IN_WILDERNESS) == 1 || WorldType.isPvpWorld(client.getWorldType())))
if (!(client.getVar(Varbits.IN_WILDERNESS) == 1
|| WorldType.isPvpWorld(client.getWorldType())
|| WorldType.isDeadmanWorld(client.getWorldType())))
{
return false;
}
if (WorldType.isDeadmanWorld(client.getWorldType()))
{
return true;
}
if (WorldType.isPvpWorld(client.getWorldType()))
{
if (client.getVar(Varbits.IN_WILDERNESS) != 1)