diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-10-12 10:53:37 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-10-12 10:53:37 +0300 |
commit | b60b58b627f078faba002401d300b522e0077efc (patch) | |
tree | 63527c7c7481276be26f6e80f6b53adbe15e1c9c /src/mapblock.h | |
parent | 3e975d8f28d951c911b9dc8fcbd9d2456f355b2e (diff) | |
download | minetest-b60b58b627f078faba002401d300b522e0077efc.tar.gz minetest-b60b58b627f078faba002401d300b522e0077efc.tar.bz2 minetest-b60b58b627f078faba002401d300b522e0077efc.zip |
Saner block modification flag operation for not saving everything always
Diffstat (limited to 'src/mapblock.h')
-rw-r--r-- | src/mapblock.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mapblock.h b/src/mapblock.h index 741c306eb..368290065 100644 --- a/src/mapblock.h +++ b/src/mapblock.h @@ -225,8 +225,10 @@ public: void setLightingExpired(bool expired) { - m_lighting_expired = expired; - raiseModified(MOD_STATE_WRITE_NEEDED); + if(expired != m_lighting_expired){ + m_lighting_expired = expired; + raiseModified(MOD_STATE_WRITE_NEEDED); + } } bool getLightingExpired() { @@ -239,8 +241,10 @@ public: } void setGenerated(bool b) { - raiseModified(MOD_STATE_WRITE_NEEDED); - m_generated = b; + if(b != m_generated){ + raiseModified(MOD_STATE_WRITE_NEEDED); + m_generated = b; + } } bool isValid() |