Switched to a ternary conditional

This commit is contained in:
Nathan Dinsmore 2014-06-24 14:09:30 -04:00
parent 293b1560b0
commit b94663adfc

View file

@ -472,8 +472,7 @@ public class Block extends Sprite {
public function duplicate(forClone:Boolean, forStage:Boolean = false):Block {
var newSpec:String = spec;
if (forStage && op == 'whenClicked') newSpec = 'when Stage clicked';
if (!forStage && op == 'whenClicked') newSpec = 'when this sprite clicked';
if (op == 'whenClicked') newSpec = forStage ? 'when Stage clicked' : 'when this sprite clicked';
var dup:Block = new Block(newSpec, type, (int)(forClone ? -1 : base.color), op);
dup.isRequester = isRequester;
dup.parameterNames = parameterNames;