mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 00:40:52 +01:00
Wired cannot trigger door when a Habbo is on it
This commit is contained in:
parent
0a09ff1f41
commit
986a3b323c
@ -39,16 +39,15 @@ public class InteractionGate extends HabboItem {
|
||||
|
||||
@Override
|
||||
public void onClick(GameClient client, Room room, Object[] objects) throws Exception {
|
||||
boolean isWired = (objects.length >= 2 && objects[1] instanceof WiredEffectType && objects[1] == WiredEffectType.TOGGLE_STATE);
|
||||
if (client != null && !room.hasRights(client.getHabbo()) && !isWired)
|
||||
boolean executedByWired = (objects.length >= 2 && objects[1] instanceof WiredEffectType && objects[1] == WiredEffectType.TOGGLE_STATE);
|
||||
|
||||
if (client != null && !room.hasRights(client.getHabbo()) && !executedByWired)
|
||||
return;
|
||||
|
||||
// If a Habbo is standing on a tile occupied by the gate, the gate shouldn't open/close
|
||||
if (!isWired) {
|
||||
for (RoomTile tile : room.getLayout().getTilesAt(room.getLayout().getTile(this.getX(), this.getY()), this.getBaseItem().getWidth(), this.getBaseItem().getLength(), this.getRotation()))
|
||||
if (room.hasHabbosAt(tile.x, tile.y))
|
||||
return;
|
||||
}
|
||||
|
||||
// Gate closed = 0, open = 1
|
||||
if (this.getExtradata().length() == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user