mirror of
https://github.com/moparisthebest/minetest
synced 2025-01-11 05:38:01 -05:00
Saner block modification flag operation for not saving everything always
This commit is contained in:
parent
3e975d8f28
commit
b60b58b627
@ -441,7 +441,8 @@ void MapBlock::stepObjects(float dtime, bool server, u32 daynight_ratio)
|
|||||||
*/
|
*/
|
||||||
m_objects.step(dtime, server, daynight_ratio);
|
m_objects.step(dtime, server, daynight_ratio);
|
||||||
|
|
||||||
setChangedFlag();
|
//setChangedFlag();
|
||||||
|
raiseModified(MOD_STATE_WRITE_AT_UNLOAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -225,8 +225,10 @@ public:
|
|||||||
|
|
||||||
void setLightingExpired(bool expired)
|
void setLightingExpired(bool expired)
|
||||||
{
|
{
|
||||||
m_lighting_expired = expired;
|
if(expired != m_lighting_expired){
|
||||||
raiseModified(MOD_STATE_WRITE_NEEDED);
|
m_lighting_expired = expired;
|
||||||
|
raiseModified(MOD_STATE_WRITE_NEEDED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bool getLightingExpired()
|
bool getLightingExpired()
|
||||||
{
|
{
|
||||||
@ -239,8 +241,10 @@ public:
|
|||||||
}
|
}
|
||||||
void setGenerated(bool b)
|
void setGenerated(bool b)
|
||||||
{
|
{
|
||||||
raiseModified(MOD_STATE_WRITE_NEEDED);
|
if(b != m_generated){
|
||||||
m_generated = b;
|
raiseModified(MOD_STATE_WRITE_NEEDED);
|
||||||
|
m_generated = b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isValid()
|
bool isValid()
|
||||||
|
@ -897,7 +897,7 @@ void RemoteClient::SendObjectData(
|
|||||||
{
|
{
|
||||||
block->stepObjects(dtime, true, server->m_env.getDayNightRatio());
|
block->stepObjects(dtime, true, server->m_env.getDayNightRatio());
|
||||||
stepped_blocks.insert(p, true);
|
stepped_blocks.insert(p, true);
|
||||||
block->setChangedFlag();
|
//block->setChangedFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip block if there are no objects
|
// Skip block if there are no objects
|
||||||
|
Loading…
Reference in New Issue
Block a user