File tree 3 files changed +19
-10
lines changed
3 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -274,13 +274,7 @@ Server::Server(
274
274
// Register us to receive map edit events
275
275
servermap->addEventReceiver (this );
276
276
277
- // If file exists, load environment metadata
278
- if (fs::PathExists (m_path_world + DIR_DELIM " env_meta.txt" )) {
279
- infostream << " Server: Loading environment metadata" << std::endl;
280
- m_env->loadMeta ();
281
- } else {
282
- m_env->loadDefaultMeta ();
283
- }
277
+ m_env->loadMeta ();
284
278
285
279
m_liquid_transform_every = g_settings->getFloat (" liquid_update" );
286
280
m_max_chatmessage_length = g_settings->getU16 (" chat_message_max_size" );
Original file line number Diff line number Diff line change @@ -614,6 +614,16 @@ void ServerEnvironment::saveMeta()
614
614
615
615
void ServerEnvironment::loadMeta ()
616
616
{
617
+ // If file doesn't exist, load default environment metadata
618
+ if (!fs::PathExists (m_path_world + DIR_DELIM " env_meta.txt" )) {
619
+ infostream << " ServerEnvironment: Loading default environment metadata"
620
+ << std::endl;
621
+ loadDefaultMeta ();
622
+ return ;
623
+ }
624
+
625
+ infostream << " ServerEnvironment: Loading environment metadata" << std::endl;
626
+
617
627
std::string path = m_path_world + DIR_DELIM " env_meta.txt" ;
618
628
619
629
// Open file and deserialize
@@ -664,6 +674,9 @@ void ServerEnvironment::loadMeta()
664
674
args.getU64 (" day_count" ) : 0 ;
665
675
}
666
676
677
+ /* *
678
+ * called if env_meta.txt doesn't exist (e.g. new world)
679
+ */
667
680
void ServerEnvironment::loadDefaultMeta ()
668
681
{
669
682
m_lbm_mgr.loadIntroductionTimes (" " , m_server, m_game_time);
Original file line number Diff line number Diff line change @@ -232,9 +232,6 @@ class ServerEnvironment : public Environment
232
232
*/
233
233
void saveMeta ();
234
234
void loadMeta ();
235
- // to be called instead of loadMeta if
236
- // env_meta.txt doesn't exist (e.g. new world)
237
- void loadDefaultMeta ();
238
235
239
236
u32 addParticleSpawner (float exptime);
240
237
u32 addParticleSpawner (float exptime, u16 attached_id);
@@ -371,6 +368,11 @@ class ServerEnvironment : public Environment
371
368
const Settings &cmd_args);
372
369
private:
373
370
371
+ /* *
372
+ * called if env_meta.txt doesn't exist (e.g. new world)
373
+ */
374
+ void loadDefaultMeta ();
375
+
374
376
static PlayerDatabase *openPlayerDatabase (const std::string &name,
375
377
const std::string &savedir, const Settings &conf);
376
378
/*
You can’t perform that action at this time.
0 commit comments