cap healing health

This commit is contained in:
Stephen McQuay 2013-11-14 00:16:08 -08:00
parent 527042daa8
commit 2cbef76a37
1 changed files with 3 additions and 0 deletions

View File

@ -286,6 +286,9 @@ func (r *Robot) Tick(g *game) {
r.RepairCounter -= delta
if r.RepairCounter < 0 {
r.Health += g.repair_hp
if r.Health > r.Stats.Hp {
r.Health = r.Stats.Hp
}
r.RepairCounter = g.repair_rate
}
}