Fill in the dormant rover log

This commit is contained in:
Marc Di Luzio 2020-07-19 18:47:54 +01:00
parent 211771121f
commit 04d7a5a4ca

View file

@ -77,11 +77,17 @@ func (g *NoiseWorldGen) GetObject(v maths.Vector) (obj Object) {
// Set the rover variables
r.Pos = v
// For now, mark the log as corrupted
r.AddLogEntryf("log corrupted")
// Marshal the rover data into the object data
obj.Data, err := json.Marshal(r)
b, err := json.Marshal(r)
if err == nil {
log.Fatalf("couldn't marshal rover, should never fail: %s", err)
}
}
// Store the bytes
obj.Data = b
}
return obj