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 class ActionFollow extends PetAction {
public ActionFollow() { public ActionFollow() {
super(PetTasks.FOLLOW, true); super(PetTasks.FOLLOW, false);
this.statusToRemove.add(RoomUnitStatus.MOVE);
this.statusToRemove.add(RoomUnitStatus.LAY);
this.statusToRemove.add(RoomUnitStatus.DEAD);
} }
@Override @Override
public boolean apply(Pet pet, Habbo habbo, String[] data) { 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)); Emulator.getThreading().run(new PetFollowHabbo(pet, habbo, 0));
if (pet.getHappyness() > 75) if (pet.getHappyness() > 75)

View File

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