Fixed a crash induced by lacking components of enemy hurtboxes

This commit is contained in:
RealMelwei 2025-10-17 12:54:05 +02:00
parent de06759514
commit 07b5114f23

View file

@ -31,7 +31,7 @@ func hurt(damage : int, dir : Vector2 = Vector2.ZERO, id : int = -1) -> bool:
if not id in blocked_damage_ids:
block_id(id)
if canvasItem != null: canvasItem.modulate = flashColor
$FlashTimer.start(flash_duration)
if has_node("FlashTimer"): $FlashTimer.start(flash_duration)
hp -= damage
damage_taken.emit(damage, dir, id)
return true