ZnoteAAC icon indicating copy to clipboard operation
ZnoteAAC copied to clipboard

It is not returning the guild id

Open luanluciano93 opened this issue 4 years ago • 6 comments

It is not returning the guild id

https://github.com/Znote/ZnoteAAC/blob/88a13e6d1053884536017173aa98289b97c8a81f/Lua/TFS_10/revscriptsys/playerdeath.lua#L6

luanluciano93 avatar Dec 18 '21 05:12 luanluciano93

Could you elaborate further on the problem?

It is correct that the variables guild and enemyGuild does not return the guild id. https://github.com/Znote/ZnoteAAC/blob/88a13e6d1053884536017173aa98289b97c8a81f/Lua/TFS_10/revscriptsys/playerdeath.lua#L5

They are returning the guild objects/metatables. This seems to be the intended behavior.

The guild id's are passed through the function params and is called guildId and enemyGuildId

Znote avatar Dec 18 '21 05:12 Znote

guildId and enemyGuildId are correctly arriving at the local function sendWarStatus, however when passing through the Guild(variable) it is becoming null

luanluciano93 avatar Dec 18 '21 06:12 luanluciano93

Replace: https://github.com/Znote/ZnoteAAC/blob/88a13e6d1053884536017173aa98289b97c8a81f/Lua/TFS_10/revscriptsys/playerdeath.lua#L5-L8

With:

local guild = Guild(guildId)
local enemyGuild = Guild(enemyGuildId) 
if not guild then
    print("sendWarStatus: Error: Failed to load guild data from id: ".. guildId)
    return 
end 
if not enemyGuild then
    print("sendWarStatus: Error: Failed to load guild data from id: ".. enemyGuildId)
    return 
end
print("sendWarStatus: Loading guild data: OK")

What messages do you get in console when reproducing this issue?

Znote avatar Dec 18 '21 06:12 Znote

sendWarStatus: Error: Failed to load guild data from id: 2

luanluciano93 avatar Dec 18 '21 06:12 luanluciano93

That is very weird, do you have any data associated to guild id 2 in SQL? In the guilds table? Which server distro are you using, which version?

If there is a bug with initializing a guild through its id, a workaround might be to send the player, and then use player:getGuild() to retrieve the guild object properly.

Znote avatar Dec 19 '21 02:12 Znote

That is very weird, do you have any data associated to guild id 2 in SQL? In the guilds table?

no

Which server distro are you using, which version?

nekiro tfs 1.4 8.60

I think it's a bug in the distro then, because the variables with guild ids arrive correctly and when passing through Guild(x) it changes.

luanluciano93 avatar Dec 19 '21 04:12 luanluciano93