clamp hp to zero
This commit is contained in:
parent
a3bf457fd6
commit
f3fbec98d7
@ -191,6 +191,7 @@ func (g *Match) Shoot(id player.ID, self bool) error {
|
||||
if live {
|
||||
target.hp -= g.damage
|
||||
if target.hp <= 0 {
|
||||
target.hp = 0 // in case it goes negative
|
||||
// If the target is the challenger, the match is over as well.
|
||||
if target == &g.players[1] {
|
||||
g.round = 3
|
||||
|
Loading…
Reference in New Issue
Block a user