Fix a crash issue when attempting to draw invalid item.

This can happen when using UIItem as interfaces etc.
This commit is contained in:
BenDol
2014-07-11 16:19:30 +12:00
parent 12b3bd4ee0
commit 9f7aafac0b
3 changed files with 23 additions and 19 deletions

View File

@@ -133,7 +133,7 @@ function Player:getItemsCount(itemId)
return count
end
function Player:hasState(_state, states)
function Player:hasState(state, states)
if not states then
states = self:getStates()
end
@@ -143,7 +143,7 @@ function Player:hasState(_state, states)
if pow > states then break end
local states = bit32.band(states, pow)
if states == _state then
if states == state then
return true
end
end