Bug - Fixed get_clan_name() works poorly when not in a clan

Playing as not-Ed, calling get_clan_name() while in a fight will return your current clan name.

Playing as Ed, calling get_clan_name() while in a fight causes an error:
Code:
showplayer.php: redirected to a fight page
 
That is really darn weird.

Does that happen at any point in the fight, or only when you are in the Underworld?
 
It happens calling get_clan_name() at any point in the fight. If I call it while in the Underworld then it (correctly) returns an empty string.

Oh, it's probably worth noting that the multi I'm having this issue with is not a member of a clan. I guess that could potentially be the problem rather than it specifically being Ed related.
 
Testing with a Turtle Tamer multi: I leave my clan, and enter a fight. get_clan_name() returns the name the clan I just left.

Back on the Ed multi: I join a clan, and enter a fight. get_clan_name() does not error, and returns the name of the clan I just joined.

So it looks like this is potentially related to the tracked clan being unset rather than anything to do with Ed.
 
ClanManager.getClanName() calls ClanManager.retrieveClanIdAndName(), which submits a ProfileRequest if the clanId is unset. I don't know that being in Ed necessarily has anything to do with it so much as it's possible to start your day in the middle of a combat in Ed.
 
Yeah, I don't think Ed has anything to do with it now, but I can't edit the thread title.

This wasn't related to starting the day in combat though. I suspect the clanId was unset because that multi was not, and had never been, in a clan.
 
Which, to my eye, makes this a real low priority thing. Especially since I am not willing to take my multis out of their respective clan to try to debug it.

tl;dr; Join a clan!
 
16646 sets clanId to -1 instead of 0 and clanName to an empty String instead of null when a clan name isn't found on your profile, so a new profile request won't happen from get_clan_name(). That should cut a few thousand server hits each day for ChIT users not in a clan, at least.
 
Back
Top