colyseus / colyseus-haxe

⚔ Colyseus Multiplayer SDK for Haxe

Home Page:https://docs.colyseus.io/getting-started/haxe-client/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Schema crashes on removing item from map

serjek opened this issue · comments

Following thrown when server removes item from map:
TypeError: item1.onRemove is not a function. (In 'item1.onRemove()', 'item1.onRemove' is undefined)

Specifically it crashes at Schema 678. Temp workaround is to add null check for item.onRemove at 677: if (item && isSchemaType && item.onRemove != null) although it does not fix the root of the problem, just removes the crash.

Thanks for reporting @serjek, this is actually how the JavaScript is implemented: https://github.com/colyseus/schema/blob/master/src/Schema.ts#L340-L346