Bug - Fixed Custom Combat does not abort on item not found

MCroft

Developer
Staff member
Infinite loop interaction between special action and invalid next action in CCS

It looks like I was wrong about where this is getting into a loop.

Current investigation suggests that it loops if the first action is "special action" and the next action is invalid ( I have tried both skills I can't perform and items I don't have. It's not exhaustively "all invalid actions").

It doesn't matter what the special action is (none, pickpocket, and restore MP all had the same result), but it must be first.

If there is a valid action between special action and the failed action (e.g. special action/skill sing/item opium grenade), then it fails with an error message, but without it, (e.g. special action/item opium grenade), it loops infinitely calling the same sequence that outputs "Darwinlet executes a macro!".

Note that "Darwinlet executes a macro" tries to run the next line without reporting it, which seems sorta suspicious to me, and probably why it's not testing for failure. It's like it merges the special with the next one.

--- Original post ---

Per the docs:

Code:
[B]item [I]name[/I][/B]
Uses the specified item. If you have Ambidextrous Funkslinging, another of the item will be used (if you have at least two of them, and it's not something that's only meaningful to use once), or a reusable combat item will be chosen for you. [I]Combat is aborted if you don't have the item.[/I]
This is my custom combat script, copied from the editor.
Code:
[ default ]
special action
item opium grenade[I][COLOR="#FFA500"]-- I added this to test another item and to check other locations...[/COLOR][/I]
skill saucecicle

[ haunted bathroom ]
special action
item rock band flyers
skill saucecicle


I am not getting an abort. I have over 100 repetitions of "Round 1: Darwinlet executes a macro!" in the session log for the same adventure. Eventually, I bring up the relay browser and just hit the thing and it let me get past it.

This is not location or item specific and it doesn't matter if it's an item that gets expended on use or not.

Because I am paranoid about my own changes, I duplicated this on 20482 as well as my sandbox.

View attachment session and debug combat macro item issue.txt
 
Last edited:

MCroft

Developer
Staff member
I'm gonna keep trying to trace this through FightRequest.java, but nobody should wait for me if they see a solution.
 

MCroft

Developer
Staff member
Edited title and post, as I am getting closer and feeling worse about this...
 

MCroft

Developer
Staff member
OK, I have a special case patch, but I'm not 100% pleased with it. Copypasta, blah.

This happens in Round 1 only, when an unknown item happens after Special Action.

It falls through Special Action and tries to use the item. Since it is Action="macro" instead of Action="use", when it gets called it doesn't do any of the pre-checks for actually having the item and so it fails, and there's nothing to catch the failure.

Revision 20491 aborts the CCS if the result is a failure.
 
Top