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

Improve clearing the FLAG_SAFE_FOLLOWER_MOVEMENT #5941

Open
Kasenn opened this issue Jan 3, 2025 · 0 comments
Open

Improve clearing the FLAG_SAFE_FOLLOWER_MOVEMENT #5941

Kasenn opened this issue Jan 3, 2025 · 0 comments
Labels
feature-request Requests a new feature

Comments

@Kasenn
Copy link

Kasenn commented Jan 3, 2025

Description

By default, using end in a script clears the temp flag FLAG_SAFE_FOLLOWER_MOVEMENT. However, due to the way Poryscript scripts are compiled, when the end is omitted from a poryscript, it will often be substituted with a return instead, which does not clear the flag in the same way.

In order to make the script ending return clear the flag similarly to the end, this simple change should fix it:

static const u8 *ScriptPop(struct ScriptContext *ctx)
{
    if (ctx->stackDepth == 0)
+    {
+       FlagClear(FLAG_SAFE_FOLLOWER_MOVEMENT);
        return NULL;
+    }

    ctx->stackDepth--;
    return ctx->stack[ctx->stackDepth];
}

Discord contact info

No response

@Kasenn Kasenn added the feature-request Requests a new feature label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Requests a new feature
Projects
None yet
Development

No branches or pull requests

1 participant