Fixed gob issue
This commit is contained in:
parent
2fd97a7092
commit
e02d220026
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
robot.go
4
robot.go
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user