Bug - Fixed Auto-purchasing white lightning

Veracity

Developer
Staff member
No, I'm not wearing cat ears, but uneffecting an effect I have no way to get again is not really an option >_>
Really? slyz asked you to uneffect "Yes, Can Haz", which comes from eating a cheezburger. And there is "no way" that you can ever eat another cheezburger?

Obviously, you just said something silly. However, I agree that even if the problem is caused by having that effect (which seems unlikely), we should fix the bug, rather than telling you to work around it.
 

VinnyB

Member
Oh, I assumed he was talking about the effect that mafia doesn't recognize, which is Om Nom Nom (effect #475), of which I have 1516 turns
 

VinnyB

Member
It's right between Tinnitus and Fastbreaker on my charsheet, and looking at the page source when SGEEAing confirms
 

slyz

Developer
However, I agree that even if the problem is caused by having that effect (which seems unlikely), we should fix the bug, rather than telling you to work around it.
Right. I asked if he could uneffect it to check whether the effect is causing the problem or not.

If it's not that, then we're back to either something weird in moods, or maybe concoctions refresh.
 

VinnyB

Member
Well, looks like I'll need to wait until the next time the microbrewery has an effect-granting booze to see if adding Om Nom Nom fixed the problem.

Just curious: Did you need to do anything other than complete the 475 line in the statuseffects data file?
 

Veracity

Developer
Staff member
Nope. If it had an actual in-game effect, I would have had to put something in modifiers.txt, but adding the effect to statuseffects.txt was enough to make it known to KoLmafia.

I can't see why that would have anything to do with with problem you were having. Hopefully it got rid of the bogus result processing.
 

VinnyB

Member
It's that time again! This time it's flower schnapps in the microbrewery.

Here's a log of me doing the following:
  • Start debug log
  • Opened the relay browser. Mafia popped up two "Are you sure you want to overdrink?" windows.
  • Entered chat. (nothing)
  • /searched the mall (nothing)
  • Bought something. Another pop-up from mafia.
  • Ate something. Another pop-up from mafia.
  • End debug log
Unfortunately I'm not sure whether this is shown in the log. (I ctrl-f'ed for Microbrewery and didn't get any hits.) Am I going to need to let it get me drunk again?
 

Attachments

  • DEBUG_20121008-01.txt
    430.8 KB · Views: 61

tirandys

New member
I ran into this same issue today, with it trying to constantly drink flower Schnapps until I get the overdrunk warning. Adding a breakpoint at this point shows that it's being driven from CharPaneDecorator.getMoodText():

Code:
DrinkItemRequest.allowBoozeConsumption(int, int, String) line: 336	
MicroBreweryRequest(CafeRequest).run() line: 167	
MicroBreweryRequest.run() line: 116	
RequestThread.postRequest(boolean, Runnable) line: 222	
RequestThread.postRequest(GenericRequest) line: 185	
RestaurantCommand.makeMicroBreweryRequest(String) line: 212	
UseItemCommand.use(String, String, boolean) line: 116	
EffectDatabase.getDefaultAction(String) line: 171	
MoodManager.getDefaultAction(String, String) line: 900	
CharPaneDecorator.getMoodText() line: 828	
CharPaneDecorator.decorateEffects(StringBuffer) line: 648	
CharPaneDecorator.decorate(StringBuffer) line: 131	
RequestEditorKit.applyPageAdjustments(String, StringBuffer, boolean) line: 326	
RequestEditorKit.getFeatureRichHTML(String, StringBuffer, boolean) line: 311	
RequestEditorKit.getFeatureRichHTML(String, StringBuffer) line: 227	
RelayRequest.formatResponse() line: 346	
RelayRequest(GenericRequest).run() line: 1351	
RelayRequest.run() line: 2056	
RequestThread.postRequest(boolean, Runnable) line: 222	
RequestThread.postRequest(GenericRequest) line: 185	
RelayAgent.readServerResponse() line: 519	
RelayAgent.performRelay() line: 158

It looks like when deciding whether to display the "save as mood" button, it calls getDefaultAction("lose_effect") for what seems to be "Flower Power".
This is meant to just return an action, and it's only getting ti to check it's not empty. However, it actually seems to be performing the microbrewery request instead.

The reason is that, although it passes sim=true to this request, it looks like this flag isn't used / passed to the makeMicroBreweryRequest call (unlike the use links), and so it just goes ahead and does it.

Presumably the fix should be to add a guard around this that respects the sim flag (similarly for the resteraunt). I'm still not sure how I actually got Flower Power in the first place though, so there's maybe something else that started the whole chain (possibly it did it the same way though, asking for the default flower power action for some reason)
 

lostcalpolydude

Developer
Staff member
Someone in /clan just got this from using the Maximizer (shot of flower schnapps when maximizing MP), so it isn't specific to the relay browser.

After mafia filled their liver (probably from every charpane load once they had the effect), they went back and tested in some old builds to see which ones gave a warning about overdrinking. 11311 does not pop up a warning and 11312 does.
 

tirandys

New member
Looking at the history, it was revision 11312 that introduced that sim flag. Previously it just returned the text of the command, rather than trying to find alternate methods.
 

lostcalpolydude

Developer
Staff member
11542 should fix this, I think. I was going to use KoLmafiaCLI.isExecutingCheckOnly (along with a new boolean to suppress printLine() calls), but it looks like that was intentionally not used.
 

VinnyB

Member
Looks like this is resolved: Mafia is not auto-purchasing today's Sugar Rush-granting 'brewery booze, honey mead, despite my having Sugar Rush active. Many thanks to all involved!
 
Top