From 17bef652b584ad5dfdc3ffa07719c698239d85f9 Mon Sep 17 00:00:00 2001 From: pentarctagon Date: Sat, 21 Oct 2023 22:12:06 -0500 Subject: [PATCH] Change editor event from start to prestart. fixes #7969 --- src/editor/map/map_context.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/editor/map/map_context.cpp b/src/editor/map/map_context.cpp index 780e16e7a4cb..6276e379fbd5 100644 --- a/src/editor/map/map_context.cpp +++ b/src/editor/map/map_context.cpp @@ -404,8 +404,8 @@ config map_context::convert_scenario(const config& old_scenario) } config& event = multiplayer.add_child("event"); - event["name"] = "start"; - event["id"] = "editor_event-start"; + event["name"] = "prestart"; + event["id"] = "editor_event-prestart"; // for all children that aren't [side] or [time], move them to an event // for [side]: @@ -491,6 +491,9 @@ void map_context::load_scenario() tod_manager_.reset(new tod_manager(scenario)); auto event = scenario.find_child("event", "id", "editor_event-start"); + if(!event) { + event = scenario.find_child("event", "id", "editor_event-prestart"); + } if(event) { config& evt = event.value(); @@ -640,7 +643,7 @@ config map_context::to_config() : scen.add_child("multiplayer"); scenario.remove_children("side"); - scenario.remove_children("event", [](config cfg){return cfg["id"].str() == "editor_event-start";}); + scenario.remove_children("event", [](config cfg){return cfg["id"].str() == "editor_event-start" || cfg["id"].str() == "editor_event-prestart";}); scenario["id"] = scenario_id_; scenario["name"] = t_string(scenario_name_); @@ -660,8 +663,9 @@ config map_context::to_config() // find or add the editor's start event config& event = scenario.add_child("event"); - event["name"] = "start"; - event["id"] = "editor_event-start"; + event["name"] = "prestart"; + event["id"] = "editor_event-prestart"; + event["priority"] = 1000; // write out all the scenario data below