Reverted Wired Condition inner workings because it seemed to only give problems and nullpointers

This commit is contained in:
ArpyAge 2021-09-02 01:41:33 +02:00
parent da5fa49766
commit 6049c195d6

View File

@ -46,28 +46,8 @@ public class WiredConditionTriggerOnFurni extends InteractionWiredCondition {
}
protected boolean triggerOnFurni(RoomUnit roomUnit, Room room) {
/*
* 1. If a Habbo IS NOT walking we only have to check if the Habbo is on one of the selected tiles.
* 2. If a Habbo IS walking we have to check if the next tile in the walking path is one of the selected items
* */
if (!roomUnit.isWalking()) {
THashSet<HabboItem> itemsAtUser = room.getItemsAt(roomUnit.getCurrentLocation());
return this.items.stream().anyMatch(itemsAtUser::contains);
} else {
RoomTile firstTileInPath = room.getLayout()
.findPath(roomUnit.getCurrentLocation(), roomUnit.getGoal(), roomUnit.getGoal(), roomUnit)
.peek();
if (firstTileInPath == null)
return false;
return this.items
.stream()
.anyMatch(conditionItem -> conditionItem
.getOccupyingTiles(room.getLayout())
.contains(firstTileInPath)
);
}
}
@Override