Closed andypsylon closed 10 years ago
local item = Item(uid)
item:moveTo(position)
for all movable items on that position? i thing not :-1:
local tile = Tile(oldPosition)
local items = tile:getTopDownItems()
for i = 1, #items do
local item = items[i]
item:moveTo(newPosition)
end
Can't you even try to make it yourself?
i can :) I mean, it's not a good solution! but thanks for the desire to help. Function "doRelocate" is well written? or i need to add ~"!it.isMovable()"? and add new Pull Request
Try this? function doRelocate(pos, toPos) pos.stackpos = 1 while getThingfromPos(pos).uid > 0 do doTeleportThing(getThingfromPos(pos).uid, toPos) pos.stackpos = pos.stackpos + 1 end end
Sorry for my bad Englisch :) but: I can lua very well.. good enough. That what i need is function in luascript.cpp I thing no one need doRelocate function for no movable items. And IF than maybe function with true/false option for with/without movable items.
This is how it works in OpenTibia server, so we won't change the behavior. You can do like @dalkon said for more flexibility (the overhead for doing this isn't significant, so if this is bothering you, you should do it).
Thanks for the explanation :+1:
doRelocate function relocate NOmovable items too.