Browse Source

Fixed gob issue

master
Stephen McQuay 6 years ago
parent
commit
e02d220026
2 changed files with 3 additions and 2 deletions
  1. +1
    -0
      player.go
  2. +2
    -2
      robot.go

+ 1
- 0
player.go View File

@ -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
}
}

+ 2
- 2
robot.go View File

@ -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,

Loading…
Cancel
Save