Bug - Fixed Mafia unequips buff tool when multiple are equipped

heeheehee

Developer
Staff member
I equipped a Mace of the Tortoise and Ouija Board as a turtle tamer (in-run). Whenever I tried to extend a turtle tamer buff, Mafia decided it should unequip the mace of the tortoise.

After some investigating, I think changing line... 1447? of kolmafia.request.UseSkillRequest to
Code:
			if ( tool.hasEquipped() && equippedTool == null )
should do the trick. Problem seems to be that equippedTool was getting set, then getting overridden by any other pieces of equipment that happened to be equipped.

(this also applies if you're dual-wielding Mace of the Tortoise with turtle totem, or any two distinct saucepans; that may be easier to check)
 
I think that checking for bestTool == null should be changed actually, but I'm not sure how.

A better way to do what your code does is probably
Code:
			if ( tool.hasEquipped() )
			{
				equippedTool = tool;
				bestTool = tool;
				break;
			}
I would have to look a bit more to remember what all of that code is doing.
 
Didn't the class revamp change it to always use the best tool, regardless of what is equipped?

So we can just completely scrap the equipment changing part...?
 
I think you are right.

I have an AT with a The Trickster's Trikitixa.
If she has it in inventory, AT buffs she casts have a duration of 20 turns.
If she equips a lesser accordion, AT buffs she casts STILL have a duration of 20 turns.

I tested this in the Relay Browser, not KoLmafia's GUI, so no equipment swapping occurred.

Edit: note that I did not test TT or SA buffs, but it's hard to imagine that KoL would handle those differently.
 
Maybe I should elaborate since I skipped half of the details. UseSkillRequest does not explicitly unequip the mace of the tortoise; it's unequipped as a result of trying to retrieve it. This happens because the !canInteract() piece of code ultimately sets bestItem to the best item available, but equippedTool points to the worst equipped item. One option would certainly be to add a break as lost suggested.

(Sorry if I'm rambling; not at a computer right now)
 
Maybe I should elaborate since I skipped half of the details. UseSkillRequest does not explicitly unequip the mace of the tortoise; it's unequipped as a result of trying to retrieve it. This happens because the !canInteract() piece of code ultimately sets bestItem to the best item available, but equippedTool points to the worst equipped item. One option would certainly be to add a break as lost suggested.

(Sorry if I'm rambling; not at a computer right now)

I saw all that in the code. I also saw (and so did others) that the code can be cleaned up a bit since KoL has changed the way that functionality works.
 
OK, now that I am running a Turtle Tamer with a Mace of the Tortoise and a Ouija Board, this has become a priority to me. I'll get to it this evening, unless somebody else submits before then.
 
Back
Top