Make teleporters work more like in Habbo

This commit is contained in:
Alejandro 2019-05-26 21:08:03 +03:00
parent f774e73cf9
commit 892900af33
2 changed files with 9 additions and 13 deletions

View File

@ -230,7 +230,7 @@ public class InteractionTeleport extends HabboItem
this.roomUnitID = -1; this.roomUnitID = -1;
habbo.getRoomUnit().isTeleporting = true; habbo.getRoomUnit().isTeleporting = true;
room.scheduledTasks.add(new TeleportActionOne(this, room, habbo.getClient())); Emulator.getThreading().run(new TeleportActionOne(this, room, habbo.getClient()), 500);
} }
@Override @Override

View File

@ -36,11 +36,7 @@ public class InteractionTeleportTile extends InteractionTeleport
@Override @Override
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception
{ {
if (roomUnit != null) if (roomUnit != null && this.canWalkOn(roomUnit, room, objects))
{
RoomTile currentLocation = room.getLayout().getTile(this.getX(), this.getY());
if (roomUnit.getGoal().equals(currentLocation) && this.canWalkOn(roomUnit, room, objects))
{ {
Habbo habbo = room.getHabbo(roomUnit); Habbo habbo = room.getHabbo(roomUnit);
@ -51,10 +47,10 @@ public class InteractionTeleportTile extends InteractionTeleport
if (!habbo.getRoomUnit().isTeleporting) if (!habbo.getRoomUnit().isTeleporting)
{ {
habbo.getRoomUnit().setGoalLocation(habbo.getRoomUnit().getCurrentLocation());
this.startTeleport(room, habbo); this.startTeleport(room, habbo);
} }
} }
} }
} }
} }
}