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