16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-17 23:39:18 +02:00

prepend_scn feature

This commit is contained in:
milek7
2020-10-31 01:19:37 +01:00
parent f042eaf6b4
commit c9169edf72
4 changed files with 10 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ set(DEPS_DIR ${DEPS_DIR} "${CMAKE_SOURCE_DIR}/ref")
project("eu07")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize=undefined")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined -Wformat")
#set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -fsanitize=address -fsanitize=undefined")
set(CMAKE_CXX_STANDARD 17)

View File

@@ -1166,6 +1166,10 @@ global_settings::ConfigParse(cParser &Parser) {
Parser.getTokens(1);
Parser >> map_manualswitchcontrol;
}
else if (token == "prepend_scn") {
Parser.getTokens(1);
Parser >> prepend_scn;
}
/*
else if (token == "crashdamage") {
Parser.getTokens(1);

View File

@@ -258,6 +258,7 @@ struct global_settings {
float map_highlight_distance = 3000.0f;
std::string exec_on_exit;
std::string prepend_scn;
struct extraviewport_config {
std::string monitor;

View File

@@ -91,6 +91,10 @@ state_serializer::deserialize_begin( std::string const &Scenariofile ) {
state->functionmap.emplace( function.first, std::bind( function.second, this, std::ref( state->input ), std::ref( state->scratchpad ) ) );
}
if (!Global.prepend_scn.empty()) {
state->input.injectString(Global.prepend_scn);
}
return state;
}