Fixed gob issue

This commit is contained in:
Stephen McQuay 2014-03-29 01:51:40 -07:00
parent 2fd97a7092
commit e02d220026
2 changed files with 3 additions and 2 deletions

View File

@ -76,6 +76,7 @@ func (pt *protoTalker) sender() {
for things := range pt.send { for things := range pt.send {
err := pt.enc.Encode(things) err := pt.enc.Encode(things)
if err != nil { if err != nil {
log.Println(err)
break break
} }
} }

View File

@ -32,7 +32,7 @@ type Robot struct {
ProbeResult *Collision `json:"probe_result"` ProbeResult *Collision `json:"probe_result"`
gameStats *BotStats `json:-` gameStats *BotStats `json:-`
Delta float32 `json:-` Delta float32 `json:-`
Idg *IdGenerator idg *IdGenerator
} }
type Collision struct { type Collision struct {
@ -454,7 +454,7 @@ func (r *Robot) fire(g *Game) *Projectile {
r.gameStats.Shots++ r.gameStats.Shots++
return &Projectile{ return &Projectile{
Id: r.Idg.Hash(), Id: r.idg.Hash(),
Position: r.Position, Position: r.Position,
MoveTo: *r.FireAt, MoveTo: *r.FireAt,
Damage: r.Stats.WeaponDamage, Damage: r.Stats.WeaponDamage,