Added pet swim on water

This commit is contained in:
brenoepic 2022-04-09 15:30:01 -03:00
parent 0363baf523
commit 90dfc45796

View File

@ -48,16 +48,19 @@ public class InteractionWater extends InteractionDefault {
for (Habbo habbo : room.getHabbosOnItem(this)) { for (Habbo habbo : room.getHabbosOnItem(this)) {
try { try {
this.onWalkOff(habbo.getRoomUnit(), room, empty); this.onWalkOff(habbo.getRoomUnit(), room, empty);
} catch (Exception e) { } catch (Exception ignored) {}
}
} }
for (Bot bot : room.getBotsOnItem(this)) { for (Bot bot : room.getBotsOnItem(this)) {
try { try {
this.onWalkOff(bot.getRoomUnit(), room, empty); this.onWalkOff(bot.getRoomUnit(), room, empty);
} catch (Exception e) { } catch (Exception ignored) {}
} }
for (Pet pet : room.getPetsOnItem(this)) {
try {
this.onWalkOff(pet.getRoomUnit(), room, empty);
} catch (Exception ignored) {}
} }
} }
@ -78,7 +81,9 @@ public class InteractionWater extends InteractionDefault {
return; return;
if (!pet.getRoomUnit().hasStatus(RoomUnitStatus.SWIM) && pet.getPetData().canSwim) { if (!pet.getRoomUnit().hasStatus(RoomUnitStatus.SWIM) && pet.getPetData().canSwim) {
pet.getRoomUnit().setStatus(RoomUnitStatus.SWIM, ""); pet.getRoomUnit().clearStatus();
pet.getRoomUnit().setStatus(RoomUnitStatus.SWIM, pet.getRoomUnit().getCurrentLocation().getStackHeight() + "");
pet.packetUpdate = true;
} }
} }
@ -91,7 +96,9 @@ public class InteractionWater extends InteractionDefault {
if(pet == null) if(pet == null)
return; return;
pet.getRoomUnit().clearStatus();
pet.getRoomUnit().removeStatus(RoomUnitStatus.SWIM); pet.getRoomUnit().removeStatus(RoomUnitStatus.SWIM);
pet.packetUpdate = true;
} }
@Override @Override