@Sarah Wesker Sorry for the mention just wanted to continue asking about this and didn't want to do it on a semi-solved thread.If many warnings appear in your console it is because you have scripts that pass invalid numbers to methods. reversing the PR is omitting our misuse of numbers.
example:
If we're trying to get a creature by ID, we have to use something like: local creature = Creature(1)
If we try to do local creature = Creature(-1) makes no sense, since an unsigned number is expected.
The same with others methods.
This is not necessarily about unsigned or signed numbers, but also about the limits of each type of number, so if a method expects int8_t, it will throw a warning if it passes a higher or much lower number.
So what is the case here? I just wanted to get sure I do understand it.
Lua:
pdump(toPosition)
if toPosition.x == CONTAINER_POSITION then
local containerId = toPosition.y - 64
local container = self:getContainerById(containerId)
if not container then
return RETURNVALUE_NOERROR
end
Code:
{
["y"] = 8,
["x"] = 65535,
["z"] = 0,
["stackpos"] = 0
}
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onMoveItem
LuaScriptInterface::getNumber(). Argument 2 has out-of-range value for unsigned char: -56.0
stack traceback:
[C]: in function 'getContainerById'
data/events/scripts/player.lua:58: in function <data/events/scripts/player.lua:41>
{
["y"] = 9,
["x"] = 65535,
["z"] = 0,
["stackpos"] = 0
}
Lua Script Error: [Event Interface]
data/events/scripts/player.lua:Player@onMoveItem
LuaScriptInterface::getNumber(). Argument 2 has out-of-range value for unsigned char: -55.0
stack traceback:
[C]: in function 'getContainerById'
data/events/scripts/player.lua:58: in function <data/events/scripts/player.lua:41>
C++:
Container* container = player->getContainerByID(getNumber<uint8_t>(L, 2));