Fix NullPointerException in WiredEffectMoveFurniTowards

This commit is contained in:
Beny 2019-05-15 18:00:18 +01:00
parent 577530ffe5
commit efe1fd2258

View File

@ -45,6 +45,7 @@ public class WiredEffectMoveFurniTowards extends InteractionWiredEffect
{ {
super(id, userId, item, extradata, limitedStack, limitedSells); super(id, userId, item, extradata, limitedStack, limitedSells);
this.items = new THashSet<>(); this.items = new THashSet<>();
this.lastDirections = new THashMap<>();
} }
public List<RoomUserRotation> getAvailableDirections(HabboItem item, Room room) { public List<RoomUserRotation> getAvailableDirections(HabboItem item, Room room) {
@ -98,6 +99,9 @@ public class WiredEffectMoveFurniTowards extends InteractionWiredEffect
for(HabboItem item : this.items) { for(HabboItem item : this.items) {
if(item == null)
continue;
// direction the furni will move in // direction the furni will move in
RoomUserRotation moveDirection = null; RoomUserRotation moveDirection = null;
RoomUserRotation lastDirection = lastDirections.get(item.getId()); RoomUserRotation lastDirection = lastDirections.get(item.getId());