Fixed wired trigger for one way gates

This commit is contained in:
Ilany 2020-09-17 19:10:36 +02:00
parent b28f115784
commit 9d2347cb9f

View File

@ -7,6 +7,8 @@ import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomTile; import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.rooms.RoomUnit;
import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.habbohotel.wired.WiredHandler;
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.rooms.items.ItemIntStateComposer; import com.eu.habbo.messages.outgoing.rooms.items.ItemIntStateComposer;
import com.eu.habbo.threading.runnables.RoomUnitWalkToLocation; import com.eu.habbo.threading.runnables.RoomUnitWalkToLocation;
@ -74,7 +76,6 @@ public class InteractionOneWayGate extends HabboItem {
if (unit == null) if (unit == null)
return; return;
if (tileInfront.x == unit.getX() && tileInfront.y == unit.getY()) { if (tileInfront.x == unit.getX() && tileInfront.y == unit.getY()) {
if (!currentLocation.hasUnits()) { if (!currentLocation.hasUnits()) {
List<Runnable> onSuccess = new ArrayList<Runnable>(); List<Runnable> onSuccess = new ArrayList<Runnable>();
@ -102,6 +103,7 @@ public class InteractionOneWayGate extends HabboItem {
unit.setGoalLocation(currentLocation); unit.setGoalLocation(currentLocation);
Emulator.getThreading().run(new RoomUnitWalkToLocation(unit, currentLocation, room, onSuccess, onFail)); Emulator.getThreading().run(new RoomUnitWalkToLocation(unit, currentLocation, room, onSuccess, onFail));
room.sendComposer(new ItemIntStateComposer(this.getId(), 1).compose()); room.sendComposer(new ItemIntStateComposer(this.getId(), 1).compose());
super.onWalkOn(unit, room, objects);
/* /*
room.scheduledTasks.add(new Runnable() room.scheduledTasks.add(new Runnable()