Simplified teleport price check logic.

This commit is contained in:
MobiusDevelopment
2019-10-07 15:08:26 +00:00
parent 11102d9a8d
commit d80a4dda26
2 changed files with 18 additions and 14 deletions

View File

@@ -63,9 +63,10 @@ public class ExRequestTeleport implements IClientIncomingPacket
return; return;
} }
final boolean mustPay = player.getLevel() > Config.MAX_FREE_TELEPORT_LEVEL; if (player.getLevel() > Config.MAX_FREE_TELEPORT_LEVEL)
{
final int price = teleport.getPrice(); final int price = teleport.getPrice();
if (mustPay && (price > 0)) if (price > 0)
{ {
if (player.getAdena() < price) if (player.getAdena() < price)
{ {
@@ -74,6 +75,7 @@ public class ExRequestTeleport implements IClientIncomingPacket
} }
player.reduceAdena("Teleport", price, player, true); player.reduceAdena("Teleport", price, player, true);
} }
}
player.teleToLocation(teleport.getX(), teleport.getY(), teleport.getZ()); player.teleToLocation(teleport.getX(), teleport.getY(), teleport.getZ());
} }

View File

@@ -63,9 +63,10 @@ public class ExRequestTeleport implements IClientIncomingPacket
return; return;
} }
final boolean mustPay = player.getLevel() > Config.MAX_FREE_TELEPORT_LEVEL; if (player.getLevel() > Config.MAX_FREE_TELEPORT_LEVEL)
{
final int price = teleport.getPrice(); final int price = teleport.getPrice();
if (mustPay && (price > 0)) if (price > 0)
{ {
if (player.getAdena() < price) if (player.getAdena() < price)
{ {
@@ -74,6 +75,7 @@ public class ExRequestTeleport implements IClientIncomingPacket
} }
player.reduceAdena("Teleport", price, player, true); player.reduceAdena("Teleport", price, player, true);
} }
}
player.teleToLocation(teleport.getX(), teleport.getY(), teleport.getZ()); player.teleToLocation(teleport.getX(), teleport.getY(), teleport.getZ());
} }