Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fn_jerryCanRefuel - Cancel action you get a full canister #685

Open
Avirex-Mai opened this issue May 28, 2020 · 5 comments · May be fixed by #717
Open

fn_jerryCanRefuel - Cancel action you get a full canister #685

Avirex-Mai opened this issue May 28, 2020 · 5 comments · May be fixed by #717

Comments

@Avirex-Mai
Copy link

File: fn_jerryCanRefuel
If you cancel the action while filling the canister, you will still get a full canister back.

@ghost
Copy link

ghost commented May 28, 2020

CONFIRMED!

Also: Already found the issue:
When comparing fn_jerryRefuel and fn_jerryCanRefuel it's easy to spot the mistake:

fn_jerryRefuel

    if (!alive player) exitWith {};
    if (life_interrupted) exitWith {};

fn_jerryCanRefuel

        if (!alive player) exitWith {life_action_inUse = false;};
        if (life_interrupted) exitWith {life_interrupted = false; life_action_inUse = false;};

By setting life_action_inUse and life_interrupted to false directly within the exitWith the check after the loop fails:

    if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;};
    if (player getVariable ["restrained",false]) exitWith {life_action_inUse = false;};
    if (!isNil "_badDistance") exitWith {titleText[localize "STR_ISTR_Lock_TooFar","PLAIN"]; life_action_inUse = false;};
    if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};

The if-condition is not met and hence it goes straight to call fn_handleInv and hence giving you full fuel canister even if action is cancled.

Solution: Simple copy'n'paste of the fn_jerrRefuel: Remove life_action_inUse and life_interrupted set to false within the exitWith to correctly trigger the if() condition.

@ghost
Copy link

ghost commented May 28, 2020

fixed with merge of #686 - can be closed (I guess?)

@Avirex-Mai
Copy link
Author

fixed with merge of #686 - can be closed (I guess?)

@BoGuu BoGuu reopened this May 28, 2020
@BoGuu
Copy link
Member

BoGuu commented May 28, 2020

Will need to duplicate this commit onto v5.X.X, then can close :)

@ghost ghost mentioned this issue May 28, 2020
1 task
@ghost
Copy link

ghost commented May 28, 2020

Will need to duplicate this commit onto v5.X.X, then can close :)

#689

@Edward-Bakker Edward-Bakker linked a pull request Jun 7, 2020 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants