From 95ccf4fd709769fcbdd0c1fbdb063cd698bf4ff2 Mon Sep 17 00:00:00 2001 From: grisenti Date: Wed, 31 Aug 2022 16:39:09 +0200 Subject: [PATCH] HPL1: allow if with empty statements in scripts without this, 'level01_12_water_cave_tunnels.hps' line 669 failes to compile --- .../hpl1/engine/libraries/angelscript/sources/as_compiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/hpl1/engine/libraries/angelscript/sources/as_compiler.cpp b/engines/hpl1/engine/libraries/angelscript/sources/as_compiler.cpp index 1fa38ddde2a..01dfe07c36a 100644 --- a/engines/hpl1/engine/libraries/angelscript/sources/as_compiler.cpp +++ b/engines/hpl1/engine/libraries/angelscript/sources/as_compiler.cpp @@ -4411,13 +4411,13 @@ void asCCompiler::CompileIfStatement(asCScriptNode *inode, bool *hasReturn, asCB // Add the byte code LineInstr(bc, inode->firstChild->next->tokenPos); bc->AddCode(&ifBC); - +#if 0 if( inode->firstChild->next->nodeType == snExpressionStatement && inode->firstChild->next->firstChild == 0 ) { // Don't allow if( expr ); Error(TXT_IF_WITH_EMPTY_STATEMENT, inode->firstChild->next); } - +#endif // If one of the statements call the constructor, the other must as well // otherwise it is possible the constructor is never called bool constructorCall1 = false;