Fixed a IllegalArgumentException in WiredEffectBotWalkToFurni

This commit is contained in:
Beny 2019-05-18 14:14:58 +01:00
parent 8161e28411
commit 75985a3696

View File

@ -119,21 +119,18 @@ public class WiredEffectBotWalkToFurni extends InteractionWiredEffect
this.items.remove(item);
}
for(Bot bot : bots)
{
int i = Emulator.getRandom().nextInt(this.items.size()) + 1;
int j = 1;
for (HabboItem item : this.items)
{
if(item.getRoomId() != 0 && item.getRoomId() == bot.getRoom().getId())
{
if (i == j)
{
bot.getRoomUnit().setGoalLocation(room.getLayout().getTile(item.getX(), item.getY()));
break;
} else
{
j++;
if(this.items.size() > 0) {
for (Bot bot : bots) {
int i = Emulator.getRandom().nextInt(this.items.size()) + 1;
int j = 1;
for (HabboItem item : this.items) {
if (item.getRoomId() != 0 && item.getRoomId() == bot.getRoom().getId()) {
if (i == j) {
bot.getRoomUnit().setGoalLocation(room.getLayout().getTile(item.getX(), item.getY()));
break;
} else {
j++;
}
}
}
}