summaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 96353dffb..dc18fd58f 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -873,7 +873,7 @@ void ServerEnvironment::clearAllObjects()
if(block){
block->m_static_objects.remove(id);
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "clearAllObjects");
+ MOD_REASON_CLEAR_ALL_OBJECTS);
obj->m_static_exists = false;
}
}
@@ -952,7 +952,7 @@ void ServerEnvironment::clearAllObjects()
block->m_static_objects.m_stored.clear();
block->m_static_objects.m_active.clear();
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "clearAllObjects");
+ MOD_REASON_CLEAR_ALL_OBJECTS);
num_objs_cleared += num_stored + num_active;
num_blocks_cleared++;
}
@@ -1139,7 +1139,7 @@ void ServerEnvironment::step(float dtime)
// set block to be saved when it is unloaded
if(block->getTimestamp() > block->getDiskTimestamp() + 60)
block->raiseModified(MOD_STATE_WRITE_AT_UNLOAD,
- "Timestamp older than 60s (step)");
+ MOD_REASON_BLOCK_EXPIRED);
// Run node timers
std::map<v3s16, NodeTimer> elapsed_timers =
@@ -1530,7 +1530,7 @@ u16 ServerEnvironment::addActiveObjectRaw(ServerActiveObject *object,
if(set_changed)
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "addActiveObjectRaw");
+ MOD_REASON_ADD_ACTIVE_OBJECT_RAW);
} else {
v3s16 p = floatToInt(objectpos, BS);
errorstream<<"ServerEnvironment::addActiveObjectRaw(): "
@@ -1579,7 +1579,7 @@ void ServerEnvironment::removeRemovedObjects()
if (block) {
block->m_static_objects.remove(id);
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "removeRemovedObjects/remove");
+ MOD_REASON_REMOVE_OBJECTS_REMOVE);
obj->m_static_exists = false;
} else {
infostream<<"Failed to emerge block from which an object to "
@@ -1604,7 +1604,7 @@ void ServerEnvironment::removeRemovedObjects()
block->m_static_objects.m_stored.push_back(i->second);
block->m_static_objects.m_active.erase(id);
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "removeRemovedObjects/deactivate");
+ MOD_REASON_REMOVE_OBJECTS_DEACTIVATE);
}
} else {
infostream<<"Failed to emerge block from which an object to "
@@ -1690,8 +1690,7 @@ void ServerEnvironment::activateObjects(MapBlock *block, u32 dtime_s)
// Clear stored list
block->m_static_objects.m_stored.clear();
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "stored list cleared in activateObjects due to "
- "large amount of objects");
+ MOD_REASON_TOO_MANY_OBJECTS);
return;
}
@@ -1812,7 +1811,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
block->m_static_objects.insert(id, s_obj);
obj->m_static_block = blockpos_o;
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "deactivateFarObjects: Static data moved in");
+ MOD_REASON_STATIC_DATA_ADDED);
// Delete from block where object was located
block = m_map->emergeBlock(old_static_block, false);
@@ -1825,7 +1824,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
}
block->m_static_objects.remove(id);
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "deactivateFarObjects: Static data moved out");
+ MOD_REASON_STATIC_DATA_REMOVED);
continue;
}
@@ -1890,8 +1889,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
// Only mark block as modified if data changed considerably
if(shall_be_written)
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "deactivateFarObjects: Static data "
- "changed considerably");
+ MOD_REASON_STATIC_DATA_CHANGED);
}
}
@@ -1937,8 +1935,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
// Only mark block as modified if data changed considerably
if(shall_be_written)
block->raiseModified(MOD_STATE_WRITE_NEEDED,
- "deactivateFarObjects: Static data "
- "changed considerably");
+ MOD_REASON_STATIC_DATA_CHANGED);
obj->m_static_exists = true;
obj->m_static_block = block->getPos();