Fixed Issue 1997

This commit is contained in:
Stankman 2023-06-27 09:35:32 -05:00
parent 88c4e0b288
commit a871e91cfc
2 changed files with 6 additions and 5 deletions

View File

@ -148,9 +148,14 @@ public class WiredHandler {
}
public static boolean handle(InteractionWiredTrigger trigger, final RoomUnit roomUnit, final Room room, final Object[] stuff, final THashSet<InteractionWiredEffect> effectsToExecute) {
if(!Emulator.isReady) {
return false;
}
long millis = System.currentTimeMillis();
int roomUnitId = roomUnit != null ? roomUnit.getId() : -1;
if (Emulator.isReady && ((Emulator.getConfig().getBoolean("wired.custom.enabled", false) && (trigger.canExecute(millis) || roomUnitId > -1) && trigger.userCanExecute(roomUnitId, millis)) || (!Emulator.getConfig().getBoolean("wired.custom.enabled", false) && trigger.canExecute(millis))) && trigger.execute(roomUnit, room, stuff)) {
if (((Emulator.getConfig().getBoolean("wired.custom.enabled", false) && (trigger.canExecute(millis) || roomUnitId > -1) && trigger.userCanExecute(roomUnitId, millis)) || (!Emulator.getConfig().getBoolean("wired.custom.enabled", false) && trigger.canExecute(millis))) && trigger.execute(roomUnit, room, stuff)) {
//DUNNO IF YOU HAVE TO SET EXTRADATA TO 1 IN HERE (In case of Repeaters)
trigger.activateBox(room, roomUnit, millis);
THashSet<InteractionWiredCondition> conditions = room.getRoomSpecialTypes().getConditions(trigger.getX(), trigger.getY());

View File

@ -56,10 +56,6 @@ public class UseFurnitureEvent extends MessageHandler {
}
item.onClick(this.client, room, new Object[]{state});
if (item instanceof InteractionWired) {
this.client.getHabbo().getRoomUnit().setGoalLocation(this.client.getHabbo().getRoomUnit().getCurrentLocation());
}
} catch (Exception e) {
log.error("Caught exception", e);
}