Skip to content

Commit 385d895

Browse files
committed
Remove obsolete target variable from move steps implementation
1 parent bb99a36 commit 385d895

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/blocks/motionblocks.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ void MotionBlocks::pointTowardsPos(Sprite *sprite, double x, double y)
184184
unsigned int MotionBlocks::pointTowards(VirtualMachine *vm)
185185
{
186186
std::string value = vm->getInput(0, 1)->toString();
187-
Target *target;
188187

189188
if (value == "_mouse_")
190189
pointTowardsPos(dynamic_cast<Sprite *>(vm->target()), vm->engine()->mouseX(), vm->engine()->mouseY());
@@ -198,7 +197,7 @@ unsigned int MotionBlocks::pointTowards(VirtualMachine *vm)
198197

199198
pointTowardsPos(dynamic_cast<Sprite *>(vm->target()), rng->randint(-static_cast<int>(stageWidth / 2), stageWidth / 2), rng->randint(-static_cast<int>(stageHeight / 2), stageHeight / 2));
200199
} else {
201-
target = vm->engine()->targetAt(vm->engine()->findTarget(value));
200+
Target *target = vm->engine()->targetAt(vm->engine()->findTarget(value));
202201
Sprite *sprite = dynamic_cast<Sprite *>(target);
203202

204203
if (sprite)

0 commit comments

Comments
 (0)