Fix ActionFollow

This commit is contained in:
brenoepic 2022-04-08 01:41:07 -03:00
parent 55015afd46
commit df0b34a7bd
2 changed files with 8 additions and 6 deletions

View File

@ -11,16 +11,14 @@ import com.eu.habbo.threading.runnables.PetFollowHabbo;
public class ActionFollow extends PetAction {
public ActionFollow() {
super(PetTasks.FOLLOW, true);
this.statusToRemove.add(RoomUnitStatus.MOVE);
this.statusToRemove.add(RoomUnitStatus.LAY);
this.statusToRemove.add(RoomUnitStatus.DEAD);
super(PetTasks.FOLLOW, false);
}
@Override
public boolean apply(Pet pet, Habbo habbo, String[] data) {
pet.clearPosture();
pet.clearPosture();
pet.setTask(PetTasks.FOLLOW);
Emulator.getThreading().run(new PetFollowHabbo(pet, habbo, 0));
if (pet.getHappyness() > 75)

View File

@ -39,7 +39,11 @@ public class PetFollowHabbo implements Runnable {
this.pet.setTask(PetTasks.FOLLOW);
}
}
Emulator.getThreading().run(this, 500);
if(target.distance(this.pet.getRoomUnit().getCurrentLocation()) > 1) {
Emulator.getThreading().run(this, 500);
} else {
this.pet.setTask(PetTasks.FREE);
}
}
}
}