Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fix error on using empty slot #2

Open
wants to merge 1 commit into from

1 participant

vkos
vkos
vkos commented April 12, 2012

Just very simple check that prevents error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 12, 2012
Fix error when using slot with no material 6dea197
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  gameplay.lua
2  gameplay.lua
@@ -58,7 +58,7 @@ function handleGameplayInput(player, terrain, dt)
58 58
       local y = math.ceil(cursor.y)
59 59
       if x - 1 >= player.x + player.width / 2 or x <= player.x - player.width / 2
60 60
       or y - 1 >= player.y or y <= player.y - player.height then
61  
-        if player.inventory:checkCurrent().id < 1000 then
  61
+        if player.inventory:checkCurrent().id and player.inventory:checkCurrent().id < 1000 then
62 62
           terrain:setBlock(y, x, player.inventory:takeCurrent().id)
63 63
           placeTime = 0
64 64
         end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.