Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Commit

Permalink
Potential fix for issue #74.
Browse files Browse the repository at this point in the history
isPlayerInLoot will now correctly check if loot and currentCol is valid,
otherwise returns false.
  • Loading branch information
1B0Y committed Apr 12, 2017
1 parent 8eb2ebe commit 0d962a7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions DayZ/gui/gear/functions_gear.lua
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,13 @@ function onClientOpenInventoryStopMenu()
end

function isPlayerInLoot()
if getElementData(localPlayer, "loot") then
return getElementData(localPlayer, "currentCol")
if getElementData(localPlayer, "loot") and (getElementType(getElementData(localPlayer,"loot")) == "player") then
local element = getElementData(localPlayer, "currentCol")
if not element then
return false
end

return element
end
return false
end
Expand Down

0 comments on commit 0d962a7

Please sign in to comment.