From 16719e3adca8ab81975807ac77b210f81306a75f Mon Sep 17 00:00:00 2001 From: tommy-l-ngo Date: Sun, 31 Oct 2021 23:05:22 -0500 Subject: [PATCH] Fixed bug Bug fixed: - moving the ship piece in place crashes game and triggers debugging --- godot_ship/script/game/moveShip.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/godot_ship/script/game/moveShip.gd b/godot_ship/script/game/moveShip.gd index dfda3aa..a884b8f 100644 --- a/godot_ship/script/game/moveShip.gd +++ b/godot_ship/script/game/moveShip.gd @@ -1,6 +1,5 @@ extends RigidBody2D - # Declare member variables here. Examples: # var a = 2 # var b = "text" @@ -26,7 +25,8 @@ func _input(event): if (position.x > 17.4 and position.x < 337.5) and (position.y > 20.2 and position.y < 335.5): position = position.snapped(Vector2(32, 32)) + Vector2(4, 4) else: - position = originalPos + if originalPos != null: + position = originalPos if event is InputEventMouseMotion and held: if snapOriginalPos == false: