Bug - Fixed Beehive (and electric boning knife) being decremented from inventory in error

Terion

Member
So, I've been funkslinging the beehive with other items against various monsters for its stagger effect; it's in the combat macro I'm using at the moment. I just noticed in my Session Results that it thought I was down many beehives. (The beehive should only be lost when used against the wall of skin.

I updated to r16660, and ran some battles. My Session Results now says: beehive (no-sell) (-9). And the inventory is out of sync:
Code:
> inv beehive

> inv refresh

Updating inventory...
Requests complete.

> inv beehive

beehive

[strike]Well, that's interesting. While nailing down the "reproduce bug" steps, it seems to be something with the combat macro ending the combat; when I had the macro just do the funksling, I momentarily saw the beehive listed with (-1) in my Session Results, but then it was removed. When I added two lines, attack and repeat, to the macro, it results in the error. Trying to do the combats manually also did not cause the error, so I think it's something with the macro causing Mafia to think the beehive was used, but it gets corrected when Mafia sees the data for the next round of combat; if the macro finishes the combat, so Mafia never sees the "OK, what do you want to do for the next round?" dropdowns, it doesn't correct the count.[/strike]

OK, simplified it. Mafia seems to be thinking the beehive is used up when used against monsters, and then adding it back into the inventory when it sees that you still have it (in the combat items dropdown, I expect.)

No equipment or familiars, no +ML, no autoattack.
Fight a fluffy bunny in the Dire Warren; use the beehive, which kills the bunny.
Session results shows beehive (no-sell) (-1), "/count beehive" in chat does say you have 1, but "inv beehive" does not return anything in the gCLI.
Start a fight with another fluffy bunny.
Session results removes the line item for beehive, "inv beehive" returns beehive in the gCLI.
Use the beehive to kill the bunny, and go back to (-1) in session results and nothing returned in gCLI.
Make a combat macro with a single line: use beehive
Set the combat macro to autoattack.
Attack several bunnies, and note that the Session Results decrements the beehive count with each combat: (-2), then (-3), etc.
Turn off the autoattack, and start a fight with a bunny, and note that Session Results gets incremented by one. (-3) to (-2) for example.

"testing" is the name of my macro with the single line: use beehive
I clicked Tools - Clear results and typed refresh all in the CLI before starting to make sure everything was synched to begin with.

Debug file came out over 4 MB (probably because my inventory has on the order of every item in it), but this is the gCLI output:
Code:
> debug on

[1201] The Dire Warren
Encounter: fluffy bunny
Round 0: Terion wins initiative!
Round 1: Terion uses the beehive!
Round 2: fluffy bunny takes 10 damage.
Round 2: fluffy bunny takes 10 damage.
Round 2: fluffy bunny takes 8 damage.
Round 2: Terion wins the fight!
You gain 18 Meat
You acquire an item: bunny liver
After Battle: You gain 2 Beefiness
After Battle: You gain 2 Smarm
You have 1 beehive.


> inv beehive

[1202] The Dire Warren
Encounter: fluffy bunny
Round 0: Terion wins initiative!

> inv beehive

beehive
Round 1: Terion uses the beehive!
Round 2: fluffy bunny takes 9 damage.
Round 2: fluffy bunny takes 8 damage.
Round 2: fluffy bunny takes 8 damage.
You gain 47 Meat.
Round 2: Terion wins the fight!
After Battle: A love cricket plays a jaunty tune for you. You tap your feet.
You gain 14 Meat
You acquire an item: bunny liver
After Battle: You gain 1 Beefiness
After Battle: You gain 1 Wizardliness
After Battle: You gain 2 Smarm
Setting auto-attack to Combat Macro (testing).


[1203] The Dire Warren
Encounter: Playing Fetch*
You acquire an item: tennis ball

[1203] The Dire Warren
Encounter: fluffy bunny
Round 0: Terion wins initiative!
Round 0: Terion uses the beehive!
Round 1: fluffy bunny takes 8 damage.
Round 1: fluffy bunny takes 8 damage.
Round 1: fluffy bunny takes 9 damage.
Round 1: Terion wins the fight!
You gain 14 Meat
You acquire an item: bunny liver
You acquire an item: moist barrel
After Battle: You gain 1 Muscleboundness
After Battle: You gain 3 Cheek

[1204] The Dire Warren
Encounter: fluffy bunny
Round 0: Terion wins initiative!
Round 0: Terion uses the beehive!
Round 1: fluffy bunny takes 8 damage.
Round 1: fluffy bunny takes 10 damage.
Round 1: fluffy bunny takes 8 damage.
Round 1: Terion wins the fight!
After Battle: A love grub shyly approaches you and hands you some extra Meat.
You gain 17 Meat
You acquire an item: bunny liver
After Battle: You gain 2 Strongness
After Battle: You gain 2 Cheek

> inv beehive

You have 1 beehive.


> inv beehive

Setting auto-attack to disabled.


[1205] The Dire Warren
Encounter: fluffy bunny
Round 0: Terion wins initiative!
Round 1: Terion attacks!
Round 2: fluffy bunny takes 122 damage.
Round 2: Terion wins the fight!
You gain 16 Meat
You acquire an item: bunny liver
After Battle: You gain 2 Beefiness
After Battle: You gain 2 Smarm

> inv beehive

beehive

> debug off

Let me see if I can get a smaller debug file that I can upload.

Edit: OK, got a debug file with a multi that is less cluttered (though still has some garbage you might have to wade through, sorry.) Debug file came out to 505 k.
 

Attachments

  • DEBUG_20160206.txt
    504.6 KB · Views: 61
Last edited:

heeheehee

Developer
Staff member
So, beehive is combat reusable except against wall of skin? Hm. That may require special code to handle properly.
 

Terion

Member
Yep. Haven't tested it, but the electric boning knife is similar: against the wall of bones, it destroys the wall and is used up, but when used against any other monster, it causes damage each round of combat after use.

Edit: Wiki links for reference:
http://kol.coldfront.net/thekolwiki/index.php/Beehive
http://kol.coldfront.net/thekolwiki/index.php/Electric_boning_knife

Edit edit: Yeah, looks like the knife does the same thing. Attached a debug file with just a combat against a bunny. Also, I did these tests in a new install of Mafia, no scripts or relays or nothin' added.
 

Attachments

  • DEBUG_20160206-knife.txt
    106 KB · Views: 48
Last edited:

Terion

Member
Hmm, it appears I can change the title of my first post, but that does not change the title of the whole thread; thus, the knife isn't reflected in the thread title in the Bug Reports forum.
Could an admin, if they feel it's worthwhile, add the (and electric boning knife) to the thread title? Thanks!
 

heeheehee

Developer
Staff member
Hm. I don't actually see much trouble in just marking beehive and boning knife as combat reusable, since I don't think many people who go into the shadow (and then the NS) with an autoattack macro that automatically finishes the fight, so the code for adjusting combat item count should just work..
 

zarqon

Well-known member
Thank you for this, I was about to bump this as the miscounts kept throwing off both my choiceadv-setting script and my quest script.
 
Is it intended that the beehive (and presumably the boning knife) are not decremented from inventory when they are used up against their appropriate monster? I just had WHAM go 20 rounds trying to use the beehive before realizing I didn't have it any more, and Mafia did still report a beehive in my inventory despite not actually having one.
 

zarqon

Well-known member
This issue is fixed for most cases, and probably would be an extremely marginal issue otherwise, except that BatBrain really seems to like beehives. For us BatBrain users, we need to "refresh inv" after fighting tower monsters to avoid getting stuck in loops of trying to use beehives we don't have. Some special handling for those items would fix it all the way.
 
Top