Bug - Fixed "Tower (Complete)" does not set familiar back to Black Cat on failure

bazfum

New member
"Tower (Complete)" in the Quests menu does not set familiar back to Black Cat on failure. I was at the familars in the Tower in Kittycore, and it told me I needed to get a Sabre-Toothed lime. I went to farm a lime from the Menagerie and only after I was in combat did I notice that I had a Mosquito rather than my Black Cat. Nowhere else have I ever seen Mafia change familiars and then not change back. Build 9829.

Sorry if this is a dupe, but I needed to rant somewhere.
 
Last edited:

slyz

Developer
I think simply removing
PHP:
if ( !KoLmafia.permitsContinue() )
{
	return -1;
}
from this loop in SorceressLairManager.java (lines 2051-2070)
PHP:
for ( ; n < 5 && KoLmafia.permitsContinue(); ++n )
{
	switch ( n )
	{
	case 2:
		SorceressLairManager.fightShadow();
		break;
	case 3:
		SorceressLairManager.familiarBattle( 3 );
		break;
	case 4:
		SorceressLairManager.familiarBattle( 4 );
		break;
	}

	if ( !KoLmafia.permitsContinue() )
	{
		return -1;
	}
}

RequestThread.postRequest( new FamiliarRequest( originalFamiliar ) );
should be enough.

If I remove that check, the check in
PHP:
for ( ; n < 5 && KoLmafia.permitsContinue(); ++n )
will still break out of the for loop, right?
 
Last edited:

Veracity

Developer
Staff member
That looks like it would work.

You may want to put the "restore original familiar" call inside a check that originalFamiliar != currentFamiliar; after all, the shadow fight can fail, and I don't think we switch familiars for that battle.
 

slyz

Developer
I was counting on FamiliarRequest to have a check for that (and apparently FamiliarRequest.run() does), but I guess it can't hurt.

r9830 (untested).
 
Top