From aeb02566d461f94a486827ce3264a5b49bf1f7de Mon Sep 17 00:00:00 2001 From: darkrose Date: Fri, 25 Jul 2014 17:24:44 +1000 Subject: [PATCH] add method to slowly delete objects --- src/defaultsettings.cpp | 1 + src/staticobject.h | 6 +++++- voxelands.conf.example | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 3154d8d..c721932 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -136,6 +136,7 @@ void set_default_settings(Settings *settings) settings->setDefault("server_unload_unused_data_timeout", "19"); settings->setDefault("server_map_save_interval", "1.238"); settings->setDefault("full_block_send_enable_min_time_from_building", "2.0"); + settings->setDefault("onload_ignore_objects","false"); settings->setDefault("enable_experimental", "false"); settings->setDefault("enable_lavabuckets", "true"); settings->setDefault("enable_tnt", "true"); diff --git a/src/staticobject.h b/src/staticobject.h index fcbc0f9..17d01a7 100644 --- a/src/staticobject.h +++ b/src/staticobject.h @@ -24,6 +24,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include "utility.h" +#include "settings.h" +#include "main.h" struct StaticObject { @@ -137,6 +139,7 @@ public: } void deSerialize(std::istream &is) { + bool drop = g_settings->getBool("onload_ignore_objects"); char buf[12]; // version is.read(buf, 1); @@ -148,7 +151,8 @@ public: { StaticObject s_obj; s_obj.deSerialize(is, version); - m_stored.push_back(s_obj); + if (!drop) + m_stored.push_back(s_obj); } } diff --git a/voxelands.conf.example b/voxelands.conf.example index 2c71acd..6e0c78e 100644 --- a/voxelands.conf.example +++ b/voxelands.conf.example @@ -179,4 +179,6 @@ # Set to true to enable experimental features or stuff that is tested # (varies from version to version, usually not useful at all) #enable_experimental = false +# a slow delete for objects, stops them being loaded from disk +#onload_ignore_objects = false