fix stick and rock spawn
This commit is contained in:
@@ -52,6 +52,11 @@ static func resolve(owner: Node3D, other: Node3D, owner_vel: Vector3) -> bool:
|
|||||||
static func _execute_recipe(a: Node3D, b: Node3D, recipe: Dictionary) -> void:
|
static func _execute_recipe(a: Node3D, b: Node3D, recipe: Dictionary) -> void:
|
||||||
var pos := (a.global_position + b.global_position) * 0.5
|
var pos := (a.global_position + b.global_position) * 0.5
|
||||||
var parent := a.get_parent()
|
var parent := a.get_parent()
|
||||||
|
# Emit before freeing so respawn counters in Main decrement correctly.
|
||||||
|
if a.has_signal("destroyed"):
|
||||||
|
a.emit_signal("destroyed")
|
||||||
|
if b.has_signal("destroyed"):
|
||||||
|
b.emit_signal("destroyed")
|
||||||
a.queue_free()
|
a.queue_free()
|
||||||
b.queue_free()
|
b.queue_free()
|
||||||
var scene: PackedScene = load(recipe["result_scene"])
|
var scene: PackedScene = load(recipe["result_scene"])
|
||||||
|
|||||||
Reference in New Issue
Block a user