mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
Pets can swim!
This commit is contained in:
parent
798da6d85a
commit
f5869158e4
@ -144,14 +144,31 @@ public class InteractionWater extends InteractionDefault {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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);
|
Pet pet = room.getPet(roomUnit);
|
||||||
|
|
||||||
if (pet != null) {
|
if(pet == null)
|
||||||
pet.getRoomUnit().setStatus(RoomUnitStatus.DIP, "0");
|
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) {
|
private void recalculate(Room room) {
|
||||||
THashMap<Short, TIntArrayList> tiles = new THashMap<>();
|
THashMap<Short, TIntArrayList> tiles = new THashMap<>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user