Skip to content

Commit 4513767

Browse files
committed
Fix world holes.
1 parent 0ca63a7 commit 4513767

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

source/modular/modules/eventdispatchermodule.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ abstract class Event
1111
private alias EventHandler = void delegate(Event event);
1212

1313
/// Event
14-
class EventDispatcherModule : IModule, IEventDispatcherModule
14+
class EventDispatcherModule : IModule
1515
{
1616
override string name() @property { return "EventDispatcherModule"; }
1717
override string semver() @property { return "1.0.0"; }

source/voxelman/chunkman.d

+8-6
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct ChunkMan
8787
storeWorker.stopWorkersWhenDone();
8888

8989
thread_joinAll();
90+
9091
}
9192

9293
void update()
@@ -113,22 +114,23 @@ struct ChunkMan
113114
chunk.hasWriter = false;
114115
chunk.isLoaded = true;
115116

117+
assert(!chunk.isUsed);
118+
116119
++totalLoadedChunks;
117120
--numLoadChunkTasks;
118121

119-
if (chunk.isMarkedForDeletion)
120-
{
121-
delete data;
122-
return;
123-
}
124-
125122
chunk.isVisible = true;
126123
if (data.chunkData.uniform)
127124
{
128125
chunk.isVisible = blockMan.blocks[data.chunkData.uniformType].isVisible;
129126
}
130127
chunk.data = data.chunkData;
131128

129+
if (chunk.isMarkedForDeletion)
130+
{
131+
return;
132+
}
133+
132134
if (chunk.isVisible)
133135
tryMeshChunk(chunk);
134136
foreach(a; chunk.adjacent)

source/voxelman/storageworker.d

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ void storageWorkerThread(Tid mainTid, string regionDir)
6464
while (isRunningLocal)
6565
{
6666
receive(
67+
// read
6768
(ivec3 chunkPos, Tid genWorker) {
6869
if (!atomicLoad(*isRunning)) return;
6970
if (regionStorage.isChunkOnDisk(chunkPos))
@@ -85,6 +86,7 @@ void storageWorkerThread(Tid mainTid, string regionDir)
8586
genWorker.send(chunkPos);
8687
}
8788
},
89+
// write
8890
(ivec3 chunkPos, shared ChunkData chunkData, bool deleteData) {
8991
writeChunk(chunkPos, cast(ChunkData)chunkData);
9092

0 commit comments

Comments
 (0)