diff --git a/src/game-lib-d3-api-scene.js b/src/game-lib-d3-api-scene.js index c93cb7d..60a6fbb 100644 --- a/src/game-lib-d3-api-scene.js +++ b/src/game-lib-d3-api-scene.js @@ -69,7 +69,7 @@ GameLib.D3.API.Scene = function( this.images = images; if (GameLib.Utils.UndefinedOrNull(fog)) { - fog = null; + fog = new GameLib.D3.API.Fog(); } this.fog = fog; diff --git a/src/game-lib-d3-geometry-buffer-a.js b/src/game-lib-d3-geometry-buffer-a.js index 076a73c..b6e4636 100644 --- a/src/game-lib-d3-geometry-buffer-a.js +++ b/src/game-lib-d3-geometry-buffer-a.js @@ -330,7 +330,11 @@ GameLib.D3.Geometry.Buffer.prototype.toApiObject = function() { this.drawRange.toApiObject(), this.groups.map( function(group){ - return group.toApiObject() + if (group instanceof GameLib.Group) { + return group.toApiObject(); + } else { + return group; + } } ), null, //index,