From 4eaf48f380385a09d1a7b78793b2e867e4769a6f Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Mon, 23 Aug 2021 18:08:14 +1000 Subject: [PATCH] move gob.Register(SceneRef) to sceneref.go --- engine/asset.go | 1 - engine/sceneref.go | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/asset.go b/engine/asset.go index 99fc354..e57a0bd 100644 --- a/engine/asset.go +++ b/engine/asset.go @@ -24,7 +24,6 @@ var ( func init() { gob.Register(AnimRef{}) gob.Register(ImageRef{}) - gob.Register(SceneRef{}) } type assetKey struct { diff --git a/engine/sceneref.go b/engine/sceneref.go index a352187..8220dee 100644 --- a/engine/sceneref.go +++ b/engine/sceneref.go @@ -15,6 +15,10 @@ var ( _ Scener = &SceneRef{} ) +func init() { + gob.Register(SceneRef{}) +} + // SceneRef loads a gzipped, gob-encoded Scene from the asset FS. // After Load, Scene is usable. // This is mostly useful for scenes that refer to other scenes, e.g.