From GenericRequest.run():
The leader of a clan is not allowed to leave. And you can't join the clan you are already in. Each of those has a recognizable failure message.
There may be other similar circumstances, but preemptively clearing the cache because you tried to go to a different clan is wrong. The new & correct KoLmafia technique is to only update internal state when you know that what was attempted succeded.
Code:
if ( location.indexOf( "clan" ) != -1 )
{
if ( location.indexOf( "action=leaveclan" ) != -1 || location.indexOf( "action=joinclan" ) != -1 )
{
ClanManager.clearCache();
}
}
There may be other similar circumstances, but preemptively clearing the cache because you tried to go to a different clan is wrong. The new & correct KoLmafia technique is to only update internal state when you know that what was attempted succeded.