cap healing health

This commit is contained in:
Stephen McQuay 2013-11-14 00:16:08 -08:00
parent 527042daa8
commit 2cbef76a37

View File

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