mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Pets can swim!
This commit is contained in:
parent
798da6d85a
commit
f5869158e4
@ -144,14 +144,31 @@ public class InteractionWater extends InteractionDefault {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWalk(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||
super.onWalkOn(roomUnit, room, objects);
|
||||
|
||||
Pet pet = room.getPet(roomUnit);
|
||||
|
||||
if (pet != null) {
|
||||
pet.getRoomUnit().setStatus(RoomUnitStatus.DIP, "0");
|
||||
if(pet == null)
|
||||
return;
|
||||
|
||||
if (!pet.getRoomUnit().hasStatus(RoomUnitStatus.SWIM)) {
|
||||
pet.getRoomUnit().setStatus(RoomUnitStatus.SWIM, "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWalkOff(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||
super.onWalkOff(roomUnit, room, objects);
|
||||
|
||||
Pet pet = room.getPet(roomUnit);
|
||||
|
||||
if(pet == null)
|
||||
return;
|
||||
|
||||
pet.getRoomUnit().removeStatus(RoomUnitStatus.SWIM);
|
||||
}
|
||||
|
||||
private void recalculate(Room room) {
|
||||
THashMap<Short, TIntArrayList> tiles = new THashMap<>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user