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

Solved Server crash - onLookInShop for container

VitoxMaster

Member
Joined
Feb 6, 2023
Messages
38
Reaction score
16
Hi everyone!
Lately I've noticed weird behavior with Player: onLookInShop call. For regular items it works perfectly, nothing to add more. But when I just use "onLook" for containers in NPC trade window (for example we're talking about backpacks) then server crashes immediately, no errors, no any sign of problem but just stops and kills the process.

I've tried to make investigation on my own but probably problem is somewhere in the engine codes (C++). My function looks as follows:
Lua:
function Player:onLookInShop(itemType, count, description)
    local description = "You see " .. description
    if hasEventCallback(EVENT_CALLBACK_ONLOOKINSHOP) then
        description = EventCallback(EVENT_CALLBACK_ONLOOKINSHOP, self, itemType, count, description)
    end
    self:sendTextMessage(MESSAGE_INFO_DESCR, description)
end

Pretty regular, nothing sophisticated. I changed that code to such:
Code:
function Player:onLookInShop(itemType, count, description)
    print(itemType:isContainer())
end
Just to check what's goin' on. Again, for regular items: weapons / potions / shields it was printing false on the console. For containers just crash, not even single true visible.

User @ralke confirmed that he has same situation (topic: here). Can someone skilled in engine development help us or, at the very least, provide a hint?
Thanks in advance!


I'm working with TFS 1.5 Nekiro's downgrade 8.6.
 
Found similar topic: solution is explained there:

 
Back
Top