forked from team-sg/hero-mark-2
fix crash when arrows collide with multiple things at once (fixes #50)
This commit is contained in:
parent
0ec9a3ec79
commit
c577f0a57c
2 changed files with 13 additions and 1 deletions
|
@ -64,6 +64,10 @@ func _exit_tree():
|
|||
get_tree().create_timer(particles.lifetime, false).connect("timeout", particles, "queue_free")
|
||||
|
||||
func _make_sparks():
|
||||
# return if this has already happened to avoid crash
|
||||
if is_queued_for_deletion():
|
||||
return
|
||||
|
||||
var particles = $SparkParticles
|
||||
remove_child(particles)
|
||||
particles.global_position = global_position + particles.position * scale.x
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue