HPL1: allow if with empty statements in scripts

without this, 'level01_12_water_cave_tunnels.hps' line 669 failes to compile
This commit is contained in:
grisenti
2022-12-23 14:03:57 +01:00
committed by Eugene Sandulenko
parent 2280049615
commit 95ccf4fd70
@@ -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;