• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

RevScripts Problem after adding movement memory leak fix

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.

1726232743349.webp

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.
 
Back
Top