From df0b34a7bd5a91ea725c3194cab4bd7b14cc4f64 Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Fri, 8 Apr 2022 01:41:07 -0300 Subject: [PATCH] Fix ActionFollow --- .../eu/habbo/habbohotel/pets/actions/ActionFollow.java | 8 +++----- .../com/eu/habbo/threading/runnables/PetFollowHabbo.java | 6 +++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollow.java b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollow.java index 767faa3f..39dff84d 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollow.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/actions/ActionFollow.java @@ -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) diff --git a/src/main/java/com/eu/habbo/threading/runnables/PetFollowHabbo.java b/src/main/java/com/eu/habbo/threading/runnables/PetFollowHabbo.java index b790916f..d5a0ebe2 100644 --- a/src/main/java/com/eu/habbo/threading/runnables/PetFollowHabbo.java +++ b/src/main/java/com/eu/habbo/threading/runnables/PetFollowHabbo.java @@ -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); + } } } }