Bug - Not A Bug Problem aborting in consult function

bumcheekcity

Active member
Code:
string a(int round, string opp, string text) {
abort("fail");
return "attack";
}

adventure(1, $location[Pond], "a");

Using the above code, I get the following battle (note that noodles/cannon is my current CSS):

Code:
> ash string a(int round, string opp, string text) {     abort("fail"); return "attack"; } adventure(1, $location[Pond], "a");

Using     1 anti-anti-antidote...
Finished using 1 anti-anti-antidote.
Searching     for "anti-anti-antidote"...
Search complete.
Purchasing     anti-anti-antidote (1 @ 30)...
You acquire an item: anti-anti-antidote
You     spent 30 Meat
Purchases complete.

Visit to Farm: Pond in     progress...

[1089] Pond
Encounter: figure-skating duck
Strategy:     C:\Users\Admin\Documents\My Dropbox\KoL Mafia\ccs\noodles,cannelioni.ccs     [default]
Round 0: bumcheekcity wins initiative!
fail
Round     1: bumcheekcity executes a macro!
Round 1: bumcheekcity casts     ENTANGLING NOODLES!
Round 2: Trobert floats up to it and pinches it     with a pair of strong, sharp, and piping-hot claws, dealing 52 damage.
Round     2: figure-skating duck takes 52 damage.
Round 2: Trobert floats above     you and shakes, sprinkling you with magical sand.
You gain 52 Mana     Points
Round 2: bumcheekcity casts CANNELLONI CANNON!
Round 3:     figure-skating duck takes 1 damage.
Round 3: Trobert floats up to it     and pinches it with a pair of strong, sharp, and piping-hot claws, dealing     62 damage.
Round 3: figure-skating duck takes 62 damage.
Round 3:     Trobert floats above you and shakes, sprinkling you with magical sand.
You     gain 62 Mana Points
Round 3: bumcheekcity casts CANNELLONI CANNON!
Round     4: figure-skating duck takes 1 damage.
Round 4: Trobert floats up to it     and pinches it with a pair of strong, sharp, and piping-hot claws, dealing     56 damage.
Round 4: figure-skating duck takes 56 damage.
Round 4:     Trobert floats above you and shakes, sprinkling you with magical sand.
You     gain 56 Mana Points
Round 4: figure-skating duck takes 1 damage.
You     lose 32 hit points
Round 4: bumcheekcity casts CANNELLONI CANNON!
Round     5: figure-skating duck takes 1 damage.
Round 5: bumcheekcity casts     CANNELLONI CANNON!
Round 6: figure-skating duck takes 1 damage.
Round     6: Trobert floats up to it and pinches it with a pair of strong, sharp,     and piping-hot claws, dealing 56 damage.
Round 6: figure-skating duck     takes 56 damage.
Round 6: Trobert floats above you and shakes,     sprinkling you with magical sand.
You gain 56 Mana Points
Round 6:     bumcheekcity wins the fight!
You gain 232 Meat
You gain 16     Strengthliness
You gain 20 Wizardliness
You gain 10 Smarm

I would expect this to abort the whole script and let the user handle the remainder of combat. Is there another way of doing this in a consult function, or is this unintended behaviour?
 

Veracity

Developer
Staff member
I'll have to consider whether I want an aborting filter to abort the enclosing script. I do note that simply returning "abort" as your action does exactly what you want. For example:

Code:
string a(int round, string opp, string text)
{
	return "abort";
}

adventure( 1, $location[Giant's Castle], "a" );
yielded this:

> filter.ash

Visit to Beanstalk: Giant's Castle in progress...

[309249] Giant's Castle
Encounter: Goth Giant
Strategy: brianna [default]
Round 0: Brianna wins initiative!
You're on your own, partner.
Click here to continue in the relay browser.
 
Top