Skip to content

Commit 89a2591

Browse files
committed
Added comments
1 parent 358c197 commit 89a2591

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

explode_object.gd

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ func _physics_process(delta):
178178
# Add a delay of 'delta' before counting the blocks.
179179
# Sometimes the last one doesn't get counted.
180180
if explosion_delay:
181-
# yield(get_tree().create_timer(delta), "timeout")
181+
# Removed the yield timer because it was throwing
182+
# 'Resumed after yield, but class instance is gone' errors
183+
# when freeing the blocks.
184+
# yield(get_tree().create_timer(delta), "timeout")
182185
explosion_delay_timer_limit = delta
183186
explosion_delay_timer += delta
184187
if explosion_delay_timer > explosion_delay_timer_limit:
@@ -270,7 +273,10 @@ func explosion(delta):
270273
# Sometimes 'object.detonate' is set to 'false' so quickly that the explosion never happens.
271274
# If this happens, try setting 'explosion_delay' to 'true'.
272275
if explosion_delay:
273-
# yield(get_tree().create_timer(delta), "timeout")
276+
# Removed the yield timer because it was throwing
277+
# 'Resumed after yield, but class instance is gone' errors
278+
# when freeing the blocks.
279+
# yield(get_tree().create_timer(delta), "timeout")
274280
explosion_delay_timer_limit = delta
275281
explosion_delay_timer += delta
276282
if explosion_delay_timer > explosion_delay_timer_limit:
@@ -289,7 +295,7 @@ func _on_debris_timer_timeout():
289295
child.set_mode(MODE_STATIC)
290296
child.get_node(object.collision_name).disabled = true
291297

292-
# Remove the self element as we don't need it anymore.
298+
# Remove the self element as we don't need it anymore.
293299
self.queue_free()
294300
else:
295301
var color_r = child.modulate.r

0 commit comments

Comments
 (0)