From e02d220026c8af253d46dbd3aa84ba7f47960767 Mon Sep 17 00:00:00 2001 From: Stephen McQuay Date: Sat, 29 Mar 2014 01:51:40 -0700 Subject: [PATCH] Fixed gob issue --- player.go | 1 + robot.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/player.go b/player.go index 2d91c8c..9f1bb31 100644 --- a/player.go +++ b/player.go @@ -76,6 +76,7 @@ func (pt *protoTalker) sender() { for things := range pt.send { err := pt.enc.Encode(things) if err != nil { + log.Println(err) break } } diff --git a/robot.go b/robot.go index 8f37d3c..66542e5 100644 --- a/robot.go +++ b/robot.go @@ -32,7 +32,7 @@ type Robot struct { ProbeResult *Collision `json:"probe_result"` gameStats *BotStats `json:-` Delta float32 `json:-` - Idg *IdGenerator + idg *IdGenerator } type Collision struct { @@ -454,7 +454,7 @@ func (r *Robot) fire(g *Game) *Projectile { r.gameStats.Shots++ return &Projectile{ - Id: r.Idg.Hash(), + Id: r.idg.Hash(), Position: r.Position, MoveTo: *r.FireAt, Damage: r.Stats.WeaponDamage,