1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Update entity_manager.js

Fixed the error on line 126. Was: 
`        const componentId = /** @type {typeof Component} */ (component.constructor).getId();`
Is:
`        const componentId = component.getId();`

In the function component should be a type of component and not an instance.
This commit is contained in:
DJ1TJOO 2020-12-20 17:51:39 +01:00 committed by GitHub
parent b41a0ca1cb
commit 36fb4def36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,7 +123,7 @@ export class EntityManager extends BasicSerializableObject {
*/
removeDynamicComponent(entity, component) {
entity.removeComponent(component, true);
const componentId = /** @type {typeof Component} */ (component.constructor).getId();
const componentId = component.getId();
fastArrayDeleteValue(this.componentToEntity[componentId], entity);
this.root.signals.entityComponentRemoved.dispatch(entity);