Itutorial
Legendary OT User
- Joined
- Dec 23, 2014
- Messages
- 2,412
- Solutions
- 68
- Reaction score
- 1,074
I implemented [Revscriptsys] fixing memory leak in Actions & Moveevents (#4742) after I get an error on two of my movement scripts. All others seem to be fine.

The only difference between these two and my other ones is they both use actionid to identify the item.
Both codes worked before the change.

The only difference between these two and my other ones is they both use actionid to identify the item.
LUA:
local moveevents = MoveEvent()
moveevents:type("stepin")
function moveevents.onStepIn(creature, item, position, fromPosition)
local player = Player(creature)
if not player then return true end
if player:isNearDepotBox() then
local depotExhaust = EXHAUSTS.DEPOT_ITEMS[player:getGuid()]
if depotExhaust and depotExhaust - os.time() > 0 then
return true
end
EXHAUSTS.DEPOT_ITEMS[player:getGuid()] = os.time() + 3
local depotItemsCount = player:getDepotItemsCount()
if depotItemsCount > 1 then
player:sendCancelMessage("Your depot contains "..depotItemsCount.." items.")
elseif depotItemsCount == 1 then
player:sendCancelMessage("Your depot contains "..depotItemsCount.." item.")
else
player:sendCancelMessage("Your depot doesn't contain any items.")
end
end
return true
end
moveevents:aid(serverAction.DEPOT_TILE_TOWN_3)
moveevents:register()
Both codes worked before the change.