From 0363baf52340818ee4bf52a97159a7334ca1cb23 Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Sat, 9 Apr 2022 15:29:32 -0300 Subject: [PATCH] Add is dragon check --- .../interactions/pets/InteractionPetTree.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/pets/InteractionPetTree.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/pets/InteractionPetTree.java index 9e273ebd..3369312c 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/pets/InteractionPetTree.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/pets/InteractionPetTree.java @@ -41,18 +41,12 @@ public class InteractionPetTree extends InteractionDefault { } } - @Override - public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) { - Pet pet = room.getPet(roomUnit); - return (roomUnit.getRoomUnitType() == RoomUnitType.PET && pet != null && pet.getPetData().getType() == 12); - } - @Override public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception { super.onWalkOn(roomUnit, room, objects); Pet pet = room.getPet(roomUnit); - if (pet != null && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoal())) { + if (pet != null && pet.getPetData().getType() == 12 && this.getOccupyingTiles(room.getLayout()).contains(pet.getRoomUnit().getGoal())) { RoomUnitStatus task = RoomUnitStatus.HANG; switch(pet.getTask()){ case RING_OF_FIRE: task = RoomUnitStatus.RINGOFFIRE; break; @@ -101,6 +95,13 @@ public class InteractionPetTree extends InteractionDefault { pet.packetUpdate = true; } } + + @Override + public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) { + Pet pet = room.getPet(roomUnit); + return roomUnit.getRoomUnitType() == RoomUnitType.PET && pet != null; + } + @Override public boolean allowWiredResetState() { return false;