From 6ceaabc28c712f82c6100f8288af66774bfdbb82 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Tue, 21 Apr 2020 12:15:56 -0400 Subject: make consistent with gen 3's version again --- src/script.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/script.c b/src/script.c index e8b8ee60..0a9a85cf 100644 --- a/src/script.c +++ b/src/script.c @@ -51,47 +51,45 @@ extern void ErrorHandling(void); u8 RunScriptCommand(struct ScriptContext *ctx) { - struct ScriptContext *localCtx = ctx; - - if (localCtx->mode == 0) + if (ctx->mode == 0) return FALSE; - switch (localCtx->mode) + switch (ctx->mode) { case 0: return FALSE; case 2: - if (localCtx->nativePtr) + if (ctx->nativePtr) { - if (localCtx->nativePtr(ctx) == TRUE) - localCtx->mode = 1; + if (ctx->nativePtr(ctx) == TRUE) + ctx->mode = 1; return TRUE; } - localCtx->mode = 1; + ctx->mode = 1; case 1: while (1) { u16 cmdCode; ScrCmdFunc *func; - if (!localCtx->scriptPtr) + if (!ctx->scriptPtr) { - localCtx->mode = 0; + ctx->mode = 0; return FALSE; } - cmdCode = ScriptReadHalfword(localCtx); - u32 cmdTableEnd = (u32)localCtx->cmdTableEnd; + cmdCode = ScriptReadHalfword(ctx); + u32 cmdTableEnd = (u32)ctx->cmdTableEnd; if (cmdCode >= cmdTableEnd) { ErrorHandling(); - localCtx->mode = 0; + ctx->mode = 0; return FALSE; } - func = &localCtx->cmdTable[cmdCode]; + func = &ctx->cmdTable[cmdCode]; - if ((*func)(localCtx) == 1) + if ((*func)(ctx) == 1) break; } } -- cgit v1.2.3