Fix rollers with setspeed 0. Closes #90

This commit is contained in:
Alejandro 2019-05-17 16:58:59 +03:00
parent df5c761d2d
commit 7b8aeeec6a

View File

@ -63,18 +63,14 @@ public class RoomUnitOnRollerComposer extends MessageComposer
{
RoomTile rollerTile = room.getLayout().getTile(this.roller.getX(), this.roller.getY());
Emulator.getThreading().run(new Runnable() {
@Override
public void run() {
if (RoomUnitOnRollerComposer.this.oldLocation == rollerTile && RoomUnitOnRollerComposer.this.roomUnit.getGoal() == rollerTile)
{
RoomUnitOnRollerComposer.this.roomUnit.setLocation(room.getLayout().getTile(newLocation.x, newLocation.y));
RoomUnitOnRollerComposer.this.roomUnit.setPreviousLocationZ(RoomUnitOnRollerComposer.this.newLocation.getStackHeight());
RoomUnitOnRollerComposer.this.roomUnit.setZ(RoomUnitOnRollerComposer.this.newLocation.getStackHeight());
RoomUnitOnRollerComposer.this.roomUnit.sitUpdate = true;
}
Emulator.getThreading().run(() -> {
if (RoomUnitOnRollerComposer.this.oldLocation == rollerTile && RoomUnitOnRollerComposer.this.roomUnit.getGoal() == rollerTile) {
RoomUnitOnRollerComposer.this.roomUnit.setLocation(room.getLayout().getTile(newLocation.x, newLocation.y));
RoomUnitOnRollerComposer.this.roomUnit.setPreviousLocationZ(RoomUnitOnRollerComposer.this.newLocation.getStackHeight());
RoomUnitOnRollerComposer.this.roomUnit.setZ(RoomUnitOnRollerComposer.this.newLocation.getStackHeight());
RoomUnitOnRollerComposer.this.roomUnit.sitUpdate = true;
}
}, 500);
}, this.room.getRollerSpeed() == 0 ? 250 : 500);
}
else
{