From f4efde2be19c33d2b0c71ad59dec45fc8728cf9d Mon Sep 17 00:00:00 2001 From: Philipp Fleischhacker Date: Tue, 30 Apr 2019 19:58:02 +0200 Subject: [PATCH] [STCC-193] Insert true condition if the block has an empty condition (#122) --- src/scratchtocatrobat/scratch/scratch3visitor/visitorUtil.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scratchtocatrobat/scratch/scratch3visitor/visitorUtil.py b/src/scratchtocatrobat/scratch/scratch3visitor/visitorUtil.py index efe4d446..89ee2e99 100644 --- a/src/scratchtocatrobat/scratch/scratch3visitor/visitorUtil.py +++ b/src/scratchtocatrobat/scratch/scratch3visitor/visitorUtil.py @@ -91,7 +91,8 @@ def visitCondition(blockcontext): block = blockcontext.block if not "CONDITION" in block.inputs: log.warn("[Scratch3] Possibly empty condition in block {} ({})".format(blockcontext.block.name, blockcontext.block.opcode)) - return False + #if there is no condition block, it evaluates to true in scratch + return ['=', 0, 0] block_id = blockcontext.getInput("CONDITION")[1] conditionblock = blockcontext.get_block(block_id)