Originally posted by [b]Dark Poet[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=1693
upon leaving a guild, the SQL tables update properly to reset a player's guild data. However, the player's map_session_data fails to update it, causing data to not be synchronized between the SQL and active map server(s).
Relogging obviously updates the session data, but it isn't updated right on the spot. For example, player A leaves his/her guild and asks for an invite to another guild from player B. Map-server recognizes player A as already having a guild, even though player A just left his/her previous guild.
CODE
int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
{
.....
if(sd->status.account_id!=account_id ||
sd->status.char_id!=char_id || sd->status.guild_id!=guild_id ||
(agit_flag && map[sd->bl.m].flag.gvg_castle))
return 0;
intif_guild_leave(sd->status.guild_id, sd->status.account_id, sd->status.char_id,0,mes);
+
+ sd->status.guild_id = 0; // re-sync the map_session_data to match the newly zero'd guild_id in SQL [Joshua]
return 0;
}
tested and confirmed that this does update the map_session_data immediately.
This post has been edited by Dark Poet: Jun 15 2008, 11:42 PM