GM characters should buy from anywhere.

This commit is contained in:
MobiusDevelopment 2019-12-06 16:57:45 +00:00
parent 1e37904aae
commit 41876df8c3

View File

@ -53,22 +53,25 @@ public class RequestBuyItem extends ClientBasePacket
final PlayerInstance player = client.getActiveChar();
// Prevent buying items far from merchant.
if (!(player.getTarget() instanceof MerchantInstance))
if (!player.isGM())
{
return;
}
boolean found = false;
for (WorldObject object : player.getKnownObjects())
{
if ((object instanceof MerchantInstance) && (player.calculateDistance2D(object) < 250))
if (!(player.getTarget() instanceof MerchantInstance))
{
found = true;
break;
return;
}
boolean found = false;
for (WorldObject object : player.getKnownObjects())
{
if ((object instanceof MerchantInstance) && (player.calculateDistance2D(object) < 250))
{
found = true;
break;
}
}
if (!found)
{
return;
}
}
if (!found)
{
return;
}
double neededMoney = 0;