Bug - Fixed r14785 - retrieve_item from inactive familiars doesn't add them into inventory

Fluxxdog

Active member
Taking equipment from non-active familiars doesn't actually add it back into mafia's inventory until you refresh.
Code:
> ash equipped_item($slot[familiar])

Returned: Snow Suit
<snip proxy fields>

> ash use_familiar($familiar[Mosquito])

Putting Hobo Bobo the Hobo Monkey back into terrarium...
Taking Bla the Mosquito out of terrarium...
little box of fireworks is better than (none). Switching items...
Putting on little box of fireworks...
Equipment changed.
Returned: true

> ashtest clean_toys()

Stealing Snow Suit from Hobo Bobo the Hobo Monkey...
Returned: void

> ash item_amount($item[Snow Suit])

Returned: 0
Code:
void clean_toys(){
	foreach greedypaws in $familiars []{ //Reclaim special gear held by inactive familiars
		if(!have_familiar(greedypaws) || my_familiar()==greedypaws) continue; //skip if don't own or is active
		if(familiar_equipped_equipment(greedypaws)==$item[none]) continue; //skip if bare-handed... bare-pawed?
		if(to_familiar(string_modifier(familiar_equipped_equipment(greedypaws),"Equips On"))==greedypaws
			|| familiar_equipped_equipment(greedypaws)==familiar_equipment(greedypaws)) continue; //skip if have own gear
		retrieve_item(1,familiar_equipped_equipment(greedypaws));
	}
}
 

Veracity

Developer
Staff member
This is actually a KoL bug. When you request KoL to unequip a familiar, if you don't make the request with ajax=1, it shows you your terrarium - complete with the familiar still equipped with the item.

Revision 14829 gets around this bug by unequipping familiars using ajax=1
 

lostcalpolydude

Developer
Staff member
This seems to have uncovered the issue that switching familiars, and as a result having equipment automatically pulled off the old one and put onto the new one, leaves mafia thinking the item is still in your inventory.
 
Top