diff options
author | Ciaran Gultnieks <ciaran@ciarang.com> | 2014-02-20 12:55:32 +0000 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-03-02 20:39:28 +0100 |
commit | baee91bf78cdc17a401ad82ee14e2917d44be8fb (patch) | |
tree | 65a980bdc738c113d15b8b0edae68a39f6562f49 /src | |
parent | 1b840e8ef9c43324f68e119260805f878e2c5900 (diff) | |
download | minetest-baee91bf78cdc17a401ad82ee14e2917d44be8fb.tar.gz minetest-baee91bf78cdc17a401ad82ee14e2917d44be8fb.tar.bz2 minetest-baee91bf78cdc17a401ad82ee14e2917d44be8fb.zip |
Fix for unloaded but active block problem
Diffstat (limited to 'src')
-rw-r--r-- | src/environment.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index 08564046e..0e7830a26 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -796,6 +796,14 @@ neighbor_found: void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime) { + // Reset usage timer immediately, otherwise a block that becomes active + // again at around the same time as it would normally be unloaded will + // get unloaded incorrectly. (I think this still leaves a small possibility + // of a race condition between this and server::AsyncRunStep, which only + // some kind of synchronisation will fix, but it at least reduces the window + // of opportunity for it to break from seconds to nanoseconds) + block->resetUsageTimer(); + // Get time difference u32 dtime_s = 0; u32 stamp = block->getTimestamp(); |