mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Fix wired teleport loop continuing after left room
This commit is contained in:
parent
7e5cf51fba
commit
b0601b93dd
@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions.wired.effects;
|
|||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
|
import com.eu.habbo.habbohotel.items.interactions.InteractionTeleportTile;
|
||||||
import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect;
|
import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect;
|
||||||
import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger;
|
import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
@ -160,7 +161,9 @@ public class WiredEffectTeleport extends InteractionWiredEffect
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
topItem.onWalkOn(roomUnit, room, new Object[] { });
|
if(roomUnit != null && roomUnit.getRoom() != null) {
|
||||||
|
topItem.onWalkOn(roomUnit, room, new Object[]{});
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -705,8 +705,14 @@ public class RoomManager
|
|||||||
r.removeFromQueue(habbo);
|
r.removeFromQueue(habbo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
habbo.getHabboInfo().setRoomQueueId(0);
|
habbo.getHabboInfo().setRoomQueueId(0);
|
||||||
habbo.getClient().sendResponse(new HideDoorbellComposer(""));
|
habbo.getClient().sendResponse(new HideDoorbellComposer(""));
|
||||||
|
|
||||||
|
if(habbo.getRoomUnit() != null) {
|
||||||
|
habbo.getRoomUnit().setRoom(null);
|
||||||
|
}
|
||||||
|
|
||||||
habbo.setRoomUnit(new RoomUnit());
|
habbo.setRoomUnit(new RoomUnit());
|
||||||
|
|
||||||
habbo.getRoomUnit().clearStatus();
|
habbo.getRoomUnit().clearStatus();
|
||||||
|
@ -833,4 +833,8 @@ public class RoomUnit
|
|||||||
public void setCanLeaveRoomByDoor(boolean canLeaveRoomByDoor) {
|
public void setCanLeaveRoomByDoor(boolean canLeaveRoomByDoor) {
|
||||||
this.canLeaveRoomByDoor = canLeaveRoomByDoor;
|
this.canLeaveRoomByDoor = canLeaveRoomByDoor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRoom(Room room) {
|
||||||
|
this.room = room;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,9 @@ public class RoomUnitTeleport implements Runnable
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
|
if(roomUnit == null || roomUnit.getRoom() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
RoomTile t = this.room.getLayout().getTile((short) this.x, (short) this.y);
|
RoomTile t = this.room.getLayout().getTile((short) this.x, (short) this.y);
|
||||||
|
|
||||||
HabboItem topItem = this.room.getTopItemAt(this.roomUnit.getCurrentLocation().x, this.roomUnit.getCurrentLocation().y);
|
HabboItem topItem = this.room.getTopItemAt(this.roomUnit.getCurrentLocation().x, this.roomUnit.getCurrentLocation().y);
|
||||||
@ -58,13 +61,6 @@ public class RoomUnitTeleport implements Runnable
|
|||||||
this.roomUnit.setLocation(t);
|
this.roomUnit.setLocation(t);
|
||||||
this.room.sendComposer(teleportMessage);
|
this.room.sendComposer(teleportMessage);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.room.updateHabbosAt(t.x, t.y);
|
this.room.updateHabbosAt(t.x, t.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user