From: Ciaran Gultnieks Date: Thu, 20 Feb 2014 12:55:32 +0000 (+0000) Subject: Fix for unloaded but active block problem X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=baee91bf78cdc17a401ad82ee14e2917d44be8fb;p=zefram%2Fminetest%2Fminetest_engine.git Fix for unloaded but active block problem --- diff --git a/src/environment.cpp b/src/environment.cpp index 08564046..0e7830a2 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();