Simplified teleport price check logic.
This commit is contained in:
@@ -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());
|
||||||
}
|
}
|
||||||
|
@@ -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());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user