Make teleporters invalidate room kick at door

This commit is contained in:
Alejandro 2019-05-28 20:28:44 +03:00
parent 79f7a8e434
commit 30c2936050
3 changed files with 15 additions and 1 deletions

View File

@ -216,4 +216,9 @@ public class InteractionTeleport extends HabboItem {
public boolean isUsable() { public boolean isUsable() {
return true; return true;
} }
@Override
public boolean invalidatesToRoomKick() {
return true;
}
} }

View File

@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.rooms;
import com.eu.habbo.Emulator; import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.items.interactions.InteractionGuildGate; import com.eu.habbo.habbohotel.items.interactions.InteractionGuildGate;
import com.eu.habbo.habbohotel.items.interactions.InteractionTeleport;
import com.eu.habbo.habbohotel.pets.Pet; import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.RideablePet; import com.eu.habbo.habbohotel.pets.RideablePet;
import com.eu.habbo.habbohotel.users.DanceType; import com.eu.habbo.habbohotel.users.DanceType;
@ -332,7 +333,13 @@ public class RoomUnit {
this.resetIdleTimer(); this.resetIdleTimer();
if (habbo != null) { if (habbo != null) {
if (this.canLeaveRoomByDoor && next.x == room.getLayout().getDoorX() && next.y == room.getLayout().getDoorY() && (!room.isPublicRoom()) || (room.isPublicRoom() && Emulator.getConfig().getBoolean("hotel.room.public.doortile.kick"))) { HabboItem topItem = this.room.getTopItemAt(next.x, next.y);
boolean isAtDoor = next.x == room.getLayout().getDoorX() && next.y == room.getLayout().getDoorY();
boolean publicRoomKicks = !room.isPublicRoom() || Emulator.getConfig().getBoolean("hotel.room.public.doortile.kick");
boolean invalidated = topItem != null && topItem.invalidatesToRoomKick();
if (this.canLeaveRoomByDoor && isAtDoor && publicRoomKicks && !invalidated) {
Emulator.getThreading().run(new RoomUnitKick(habbo, room, false), 500); Emulator.getThreading().run(new RoomUnitKick(habbo, room, false), 500);
} }
} }

View File

@ -462,4 +462,6 @@ public abstract class HabboItem implements Runnable, IEventTriggers {
public void setFromGift(boolean fromGift) { public void setFromGift(boolean fromGift) {
isFromGift = fromGift; isFromGift = fromGift;
} }
public boolean invalidatesToRoomKick() { return false; }
} }