fix: production

This commit is contained in:
cha0s 2024-06-23 03:04:48 -05:00
parent db1baa5db4
commit 92b167237d
3 changed files with 10 additions and 8 deletions

View File

@ -17,7 +17,7 @@ for (const componentName in specificationsAndOrDecorators) {
if ('function' === typeof specificationOrDecorator) {
Components[componentName] = specificationOrDecorator(
class Decorated extends Arbitrary {
static name = componentName;
static componentName = componentName;
}
);
if (!Components[componentName]) {
@ -26,7 +26,7 @@ for (const componentName in specificationsAndOrDecorators) {
}
else {
Components[componentName] = class Component extends Arbitrary {
static name = componentName;
static componentName = componentName;
static schema = new Schema({
type: 'object',
properties: specificationOrDecorator,

View File

@ -83,7 +83,7 @@ export default class Base {
}
markChange(entityId, key, value) {
this.ecs.markChange(entityId, {[this.constructor.name]: {[key]: value}})
this.ecs.markChange(entityId, {[this.constructor.componentName]: {[key]: value}})
}
mergeDiff(original, update) {

View File

@ -51,8 +51,10 @@ onmessage = async (event) => {
postMessage(encode({type: 'ConnectionStatus', payload: 'connected'}));
})();
import.meta.hot.accept('../../engine/engine.js', async () => {
await engine.disconnectPlayer(0, 0);
postMessage(encode({type: 'ConnectionStatus', payload: 'aborted'}));
close();
});
if (import.meta.hot) {
import.meta.hot.accept('../../engine/engine.js', async () => {
await engine.disconnectPlayer(0, 0);
postMessage(encode({type: 'ConnectionStatus', payload: 'aborted'}));
close();
});
}