From b01654ec769633bceb991e08b5649ae786695aae Mon Sep 17 00:00:00 2001 From: Fraser Graham Date: Thu, 7 Nov 2013 20:50:17 -0800 Subject: [PATCH] minor tweak to projectile scanning --- player.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/player.go b/player.go index 6ba81d5..f896486 100644 --- a/player.go +++ b/player.go @@ -190,6 +190,7 @@ func (p *player) Tick(g *game) { } } + // We only self repair when we're stopped if math.Abs(float64(p.Robot.Speed)) < v.Epsilon && p.Robot.RepairCounter > 0 { p.Robot.RepairCounter -= delta if p.Robot.RepairCounter < 0 { @@ -231,7 +232,7 @@ func (p *player) scan(g *game) { } for proj, _ := range g.projectiles { - if proj.Owner.Robot.Id == p.Robot.Id { + if proj.Owner == p { continue }