minor tweak to projectile scanning

This commit is contained in:
Fraser Graham 2013-11-07 20:50:17 -08:00
parent eabc1ebb41
commit b01654ec76

View File

@ -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 { if math.Abs(float64(p.Robot.Speed)) < v.Epsilon && p.Robot.RepairCounter > 0 {
p.Robot.RepairCounter -= delta p.Robot.RepairCounter -= delta
if p.Robot.RepairCounter < 0 { if p.Robot.RepairCounter < 0 {
@ -231,7 +232,7 @@ func (p *player) scan(g *game) {
} }
for proj, _ := range g.projectiles { for proj, _ := range g.projectiles {
if proj.Owner.Robot.Id == p.Robot.Id { if proj.Owner == p {
continue continue
} }