fixed bug with set_hp in damageable object
This commit is contained in:
parent
30b488094a
commit
de19a4c32d
@ -18,7 +18,8 @@ func _ready():
|
|||||||
set_hp(starting_hp)
|
set_hp(starting_hp)
|
||||||
|
|
||||||
func take_damage(damage : int = 1):
|
func take_damage(damage : int = 1):
|
||||||
set_hp(current_hp - max_hp)
|
assert(damage > 0)
|
||||||
|
set_hp(current_hp - damage)
|
||||||
|
|
||||||
func set_hp(hp_to_set : int):
|
func set_hp(hp_to_set : int):
|
||||||
current_hp = clamp(hp_to_set,0,max_hp)
|
current_hp = clamp(hp_to_set,0,max_hp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user