lazarus321
Member
- Joined
- May 8, 2017
- Messages
- 222
- Reaction score
- 23
Anyone know why is this error happening? I moved the bow from the right hand to the left and it appeared this error, the opposite does not happen error.

function in player.lua,

C++:
Lua Script Error: [Event Interface]
data/events/scripts/party.lua:Player@onMoveItem
data/events/scripts/player.lua:119: attempt to call method 'getSize' (a nil value)
stack traceback:
[C]: in function 'getSize'
data/events/scripts/player.lua:119: in function <data/events/scripts/player.lua:100>
function in player.lua,
C++:
function Player:onMoveItem(item, count, fromPosition, toPosition, fromCylinder, toCylinder)
if toPosition.x ~= CONTAINER_POSITION then
return true
end
if item:getTopParent() == self and bit.band(toPosition.y, 0x40) == 0 then
local itemType, moveItem = ItemType(item:getId())
if bit.band(itemType:getSlotPosition(), SLOTP_TWO_HAND) ~= 0 and toPosition.y == CONST_SLOT_LEFT then
moveItem = self:getSlotItem(CONST_SLOT_RIGHT)
elseif itemType:getWeaponType() == WEAPON_SHIELD and toPosition.y == CONST_SLOT_RIGHT then
moveItem = self:getSlotItem(CONST_SLOT_LEFT)
if moveItem and bit.band(ItemType(moveItem:getId()):getSlotPosition(), SLOTP_TWO_HAND) == 0 then
return true
end
end
if moveItem then
local parent = item:getParent()
if parent:getSize() == parent:getCapacity() then
self:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_CONTAINERNOTENOUGHROOM))
return false
else
return moveItem:moveTo(parent)
end
end
end
return true
end