Fixed a crash induced by lacking components of enemy hurtboxes
This commit is contained in:
parent
de06759514
commit
07b5114f23
1 changed files with 1 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ func hurt(damage : int, dir : Vector2 = Vector2.ZERO, id : int = -1) -> bool:
|
||||||
if not id in blocked_damage_ids:
|
if not id in blocked_damage_ids:
|
||||||
block_id(id)
|
block_id(id)
|
||||||
if canvasItem != null: canvasItem.modulate = flashColor
|
if canvasItem != null: canvasItem.modulate = flashColor
|
||||||
$FlashTimer.start(flash_duration)
|
if has_node("FlashTimer"): $FlashTimer.start(flash_duration)
|
||||||
hp -= damage
|
hp -= damage
|
||||||
damage_taken.emit(damage, dir, id)
|
damage_taken.emit(damage, dir, id)
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue