Merge pull request #192 from argonui/pickup-fix
Fix check for missing metadata in PlayArea onObjectPickup
This commit is contained in:
commit
2e92953a24
@ -140,7 +140,7 @@ function onObjectPickUp(player, object)
|
|||||||
-- should be tracking
|
-- should be tracking
|
||||||
if showLocationLinks() and isInPlayArea(object) and object.getGMNotes() ~= nil and object.getGMNotes() ~= "" then
|
if showLocationLinks() and isInPlayArea(object) and object.getGMNotes() ~= nil and object.getGMNotes() ~= "" then
|
||||||
local pickedUpGuid = object.getGUID()
|
local pickedUpGuid = object.getGUID()
|
||||||
local metadata = JSON.decode(object.getGMNotes())
|
local metadata = JSON.decode(object.getGMNotes()) or { }
|
||||||
if (metadata.type == "Location") then
|
if (metadata.type == "Location") then
|
||||||
-- onCollisionExit sometimes comes 1 frame after onObjectPickUp (rather than before it or in
|
-- onCollisionExit sometimes comes 1 frame after onObjectPickUp (rather than before it or in
|
||||||
-- the same frame). This causes a mismatch in the data between dragging the on-table, and
|
-- the same frame). This causes a mismatch in the data between dragging the on-table, and
|
||||||
|
Loading…
x
Reference in New Issue
Block a user