File tree Expand file tree Collapse file tree 4 files changed +11
-9
lines changed Expand file tree Collapse file tree 4 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ export async function runGameServer(): Promise<void> {
130
130
world = new World ( ) ;
131
131
await injectPlugins ( ) ;
132
132
133
- world . init ( ) ; // .then(() => delete cache.mapData);
133
+ world . init ( ) ; // .then(() => delete cache.mapData);
134
134
135
135
if ( process . argv . indexOf ( '-fakePlayers' ) !== - 1 ) {
136
136
world . generateFakePlayers ( ) ;
Original file line number Diff line number Diff line change @@ -170,10 +170,10 @@ export class Pathfinding {
170
170
throw new Error ( `Out of range.` ) ;
171
171
}
172
172
173
- let destinationIndexX = destinationX - position . x + searchRadius ;
174
- let destinationIndexY = destinationY - position . y + searchRadius ;
175
- let startingIndexX = searchRadius ;
176
- let startingIndexY = searchRadius ;
173
+ const destinationIndexX = destinationX - position . x + searchRadius ;
174
+ const destinationIndexY = destinationY - position . y + searchRadius ;
175
+ const startingIndexX = searchRadius ;
176
+ const startingIndexY = searchRadius ;
177
177
178
178
const pointLen = searchRadius * 2 ;
179
179
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export class ChunkManager {
15
15
this . chunkMap = new Map < string , Chunk > ( ) ;
16
16
}
17
17
18
- public async generateCollisionMaps ( ) : Promise < void > {
18
+ public generateCollisionMaps ( ) : void {
19
19
logger . info ( 'Generating game world collision maps...' ) ;
20
20
21
21
const tileList = cache . mapData . tiles ;
Original file line number Diff line number Diff line change @@ -65,9 +65,11 @@ export class World {
65
65
}
66
66
67
67
public async init ( ) : Promise < void > {
68
- this . chunkManager . generateCollisionMaps ( ) ;
69
- this . spawnNpcs ( ) ;
70
- this . spawnScenery ( ) ;
68
+ await new Promise ( ( ) => {
69
+ this . chunkManager . generateCollisionMaps ( ) ;
70
+ this . spawnNpcs ( ) ;
71
+ this . spawnScenery ( ) ;
72
+ } ) ;
71
73
}
72
74
73
75
/**
You can’t perform that action at this time.
0 commit comments