Skip to content

Commit

Permalink
use @serjek's suggestion. closes #41
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Oct 25, 2020
1 parent 92bf118 commit 8f914ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"license": "MIT",
"tags": ["multiplayer", "networking", "websockets", "netcode"],
"description": "Multiplayer Game Client for Haxe",
"version": "0.14.4",
"version": "0.14.5",
"classPath": "src/",
"releasenote": "fix compilation with '-dce full'",
"releasenote": "fixes 'refId not found' issue.",
"contributors": ["endel"],
"dependencies": {
"colyseus-websocket": "1.0.7"
Expand Down
8 changes: 7 additions & 1 deletion src/io/colyseus/serializer/schema/Schema.hx
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,16 @@ class Schema implements IRef {
//
// FIXME: Type.getClass(previousValue)
// This may not be a reliable call, in case the previousValue is `null`.
// (The unity3d client does not have this problem because it has a different take on this)
// TODO:use Type.resolveClass("io.colyseus.serializer.schema.types.MapSchema_XXX")
//
var collectionClass = (fieldType == null)
? Type.getClass(ref)
: Type.getClass(previousValue); // CustomType.getInstance().get(fieldType)
: #if (nodejs || js)
CustomType.getInstance().get(fieldType)
#else
Type.getClass(previousValue)
#end;

var valueRef: ISchemaCollection = (refs.has(refId))
? previousValue
Expand Down

0 comments on commit 8f914ad

Please sign in to comment.