refactor: tidy
This commit is contained in:
parent
86b7b74616
commit
eb6e23f0e1
|
@ -83,13 +83,13 @@ if (import.meta.hot) {
|
||||||
const resolver = createResolver();
|
const resolver = createResolver();
|
||||||
resolvers.push(resolver);
|
resolvers.push(resolver);
|
||||||
await beforeResolver;
|
await beforeResolver;
|
||||||
const oldPlayer = await engine.server.readJson('players/0');
|
const oldPlayer = await engine.loadPlayer(0);
|
||||||
const player = await createPlayer(0);
|
const player = await createPlayer(0);
|
||||||
// Less jarring
|
// Less jarring
|
||||||
player.Ecs = oldPlayer.Ecs;
|
player.Ecs = oldPlayer.Ecs;
|
||||||
player.Direction = oldPlayer.Direction;
|
player.Direction = oldPlayer.Direction;
|
||||||
player.Position = oldPlayer.Position;
|
player.Position = oldPlayer.Position;
|
||||||
await engine.server.writeData('players/0', (new TextEncoder()).encode(JSON.stringify(player)));
|
await engine.savePlayer(0, player);
|
||||||
resolver.resolve();
|
resolver.resolve();
|
||||||
});
|
});
|
||||||
import.meta.hot.accept('./create/forest.js', async ({default: createForest}) => {
|
import.meta.hot.accept('./create/forest.js', async ({default: createForest}) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user