summaryrefslogtreecommitdiff
path: root/src/mapblock.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-28 00:45:34 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:56 +0200
commit842eb5da280b09e046531dd03fe9b9b20752ad12 (patch)
tree97d26292a9162c8c713aa3cacb0914d6c35d3b78 /src/mapblock.h
parent05df2ee8a4fe6bd4fcb1879fd418ef6ad301fcf4 (diff)
downloadminetest-842eb5da280b09e046531dd03fe9b9b20752ad12.tar.gz
minetest-842eb5da280b09e046531dd03fe9b9b20752ad12.tar.bz2
minetest-842eb5da280b09e046531dd03fe9b9b20752ad12.zip
Replace old active block random node modifying things with actual ActiveBlockModifiers
Diffstat (limited to 'src/mapblock.h')
-rw-r--r--src/mapblock.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/mapblock.h b/src/mapblock.h
index 5b27d01c3..aa5aa43f7 100644
--- a/src/mapblock.h
+++ b/src/mapblock.h
@@ -35,6 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef SERVER
#include "mapblock_mesh.h"
#endif
+#include "modifiedstate.h"
class Map;
class NodeMetadataList;
@@ -53,19 +54,6 @@ enum{
FACE_LEFT
};*/
-enum ModifiedState
-{
- // Has not been modified.
- MOD_STATE_CLEAN = 0,
- MOD_RESERVED1 = 1,
- // Has been modified, and will be saved when being unloaded.
- MOD_STATE_WRITE_AT_UNLOAD = 2,
- MOD_RESERVED3 = 3,
- // Has been modified, and will be saved as soon as possible.
- MOD_STATE_WRITE_NEEDED = 4,
- MOD_RESERVED5 = 5,
-};
-
// NOTE: If this is enabled, set MapBlock to be initialized with
// CONTENT_IGNORE.
/*enum BlockGenerationStatus
@@ -167,6 +155,10 @@ public:
m_modified = mod;
m_modified_reason = reason;
m_modified_reason_too_long = false;
+
+ if(m_modified >= MOD_STATE_WRITE_AT_UNLOAD){
+ m_disk_timestamp = m_timestamp;
+ }
} else if(mod == m_modified){
if(!m_modified_reason_too_long){
if(m_modified_reason.size() < 40)
@@ -509,6 +501,10 @@ public:
{
return m_timestamp;
}
+ u32 getDiskTimestamp()
+ {
+ return m_disk_timestamp;
+ }
/*
See m_usage_timer
@@ -646,6 +642,8 @@ private:
Value BLOCK_TIMESTAMP_UNDEFINED=0xffffffff means there is no timestamp.
*/
u32 m_timestamp;
+ // The on-disk (or to-be on-disk) timestamp value
+ u32 m_disk_timestamp;
/*
When the block is accessed, this is set to 0.