diff options
author | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-18 18:04:34 +0100 |
---|---|---|
committer | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-18 18:04:34 +0100 |
commit | 0eb22020e380643ec5cd2c12f983403c2dd3b751 (patch) | |
tree | ff23a3e26611c04e3ba72c8c1504b9ae86dfdeb8 /scripts/placer.gd | |
parent | f75ee64e21f67b4f27404147aedaa63750058d5a (diff) |
load map gui & start doc balance
Diffstat (limited to 'scripts/placer.gd')
-rw-r--r-- | scripts/placer.gd | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/placer.gd b/scripts/placer.gd index 032900f..991f333 100644 --- a/scripts/placer.gd +++ b/scripts/placer.gd @@ -150,8 +150,8 @@ func inst_attach (pos, rot): instance.transform.basis = Basis(rot); return instance -func inst_voxel (pos, rot): - world.set_voxel(pos + normal, int(control.selected)) +func inst_voxel (pos, rot, block): + world.set_voxel(pos + normal, int(block)) world.update_mesh() func nearest_child (node, pos): @@ -254,7 +254,7 @@ func _pointer (): Globals.StateType.PATH: g = "path" match control.selected: - "start path": g = "voxel" + "start path": g = "voxels" if Input.is_action_just_pressed("use"): if colliding && g in colliding_group: @@ -266,6 +266,7 @@ func _pointer (): else: control.do(Globals.PlayerActions.CANCEL) if Input.is_action_just_pressed("cancel"): - control.do(Globals.PlayerActions.DELETE, { - "pos": colliding_node.transform.origin, - "rot": colliding_node.transform.basis.get_rotation_quat() }) + if colliding: + control.do(Globals.PlayerActions.DELETE, { + "pos": colliding_node.transform.origin, + "rot": colliding_node.transform.basis.get_rotation_quat() }) |