• 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!

Crash 1.5

omaraboud

Member
Joined
Jul 19, 2014
Messages
39
Reaction score
9
Location
Iraq
Guys so today I had crash, I'm not sure whether if it's because of addevent function inside my spell? Crash usually happens right after player kills monster.

Here's a dump from Gdb
bt[New LWP 1442572][New LWP 1442573][New LWP 1442571][New LWP 1442574][Thread debugging using libthread_db enabled]Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".Core was generated by `./tfs'.Program terminated with signal SIGSEGV, Segmentation fault.#0 0x0000561935deb81a in Combat::getCombatDamage (this=0x7f4db00bfdc0, creature=0x7f4dac6e26b0, target=0x0) at /home/xxx/Downloads/TFS-1.5-Downgrades-8.60/src/combat.cpp:128128 if (creature->getCombatValues(min, max)) {--Type <RET> for more, q to quit, c to continue without paging--bt[Current thread is 1 (Thread 0x7f4db7da7700 (LWP 1442572))](gdb)

Oncast func spell of monster which is killed

Lua:
function onCastSpell(creature, variant)
addEvent(function()
combat:execute(creature, variant)   
end, 200)
    
addEvent(function()
        combat2:execute(creature, variant)
end, 600)   
addEvent(function()
        combat3:execute(creature, variant)
end, 900)   
addEvent(function()
        combat4:execute(creature, variant)
end, 1000)   
addEvent(function()
        combat5:execute(creature, variant)
end, 1600)       
    return
end
 
Solution
Lua:
local function firstcastSpell(creatureId, variant, isHotkey)
    local creature = Creature(creatureId)
    if not creature then
        return
    end
   -- local target = Creature(variant:getNumber())
 --   if target == nil then
 --       return
 --end

        combat:execute(creature, variant)


end
function onCastSpell(creature, variant)
    safeAddEvent(firstcastSpell, 200, creature:getId(), variant)

    return true
end
 
Back
Top