Skip to content

Commit

Permalink
Merge pull request #3 from pfthroaway/master
Browse files Browse the repository at this point in the history
Prevented a crash if you don't click in a slot.
  • Loading branch information
Oen44 authored Nov 3, 2019
2 parents 56d2b55 + ee7aee1 commit af5b78d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Inventory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ func _gui_input(event):
if isClicked:
clickedSlot = slot;

if holdingItem != null:
if holdingItem == null and clickedSlot == null:
return

if holdingItem != null and clickedSlot != null:
if clickedSlot.item != null:
var tempItem = clickedSlot.item;
var oldSlot = slotList[slotList.find(holdingItem.itemSlot)];
Expand Down

0 comments on commit af5b78d

Please sign in to comment.