Skip to content

Commit

Permalink
[STCC-193] Insert true condition if the block has an empty condition (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Fleischhacker authored and AntiDog committed Apr 30, 2019
1 parent 0fe27ba commit f4efde2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scratchtocatrobat/scratch/scratch3visitor/visitorUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f4efde2

Please # to comment.