aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/Dataloader.cpp
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-10-20 01:56:06 +0200
committer Spartan322 <Megacake1234@gmail.com>2023-10-20 10:48:38 +0200
commit3d728f054e3c214f840b7e63539aea0c4c5246b5 (patch)
treec25a4e654d597ca2ca699ffb2b1bde6b6eeba053 /src/openvic-simulation/dataloader/Dataloader.cpp
parent910d6cd73d7b1857ff481e1af060e780ec27d800 (diff)
Add Defines Loading
Caches start_date and end_date in DefineManager Add static `get_property` and HASID_PROPERTY macro to HasIdentifier
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.cpp')
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp
index cfc944d..7132d24 100644
--- a/src/openvic-simulation/dataloader/Dataloader.cpp
+++ b/src/openvic-simulation/dataloader/Dataloader.cpp
@@ -445,7 +445,7 @@ static bool _lua_parse(v2script::Parser& parser) {
return parser.lua_defines_parse();
}
-static ovdl::v2script::Parser parse_lua_defines(fs::path const& path) {
+ovdl::v2script::Parser Dataloader::parse_lua_defines(fs::path const& path) {
return _run_ovdl_parser<v2script::Parser, &_lua_parse>(path);
}
@@ -613,6 +613,7 @@ bool Dataloader::load_defines(GameManager& game_manager) const {
static const fs::path pop_type_directory = "poptypes";
static const fs::path units_directory = "units";
+ static const fs::path defines_file = "common/defines.lua";
static const fs::path buildings_file = "common/buildings.txt";
static const fs::path bookmark_file = "common/bookmarks.txt";
static const fs::path culture_file = "common/cultures.txt";
@@ -633,6 +634,10 @@ bool Dataloader::load_defines(GameManager& game_manager) const {
Logger::error("Failed to set up modifier effects!");
ret = false;
}
+ if (!game_manager.get_define_manager().load_defines_file(parse_lua_defines(lookup_file(defines_file)).get_file_node())) {
+ Logger::error("Failed to load defines!");
+ ret = false;
+ }
if (!game_manager.get_economy_manager().get_good_manager().load_goods_file(
parse_defines(lookup_file(goods_file)).get_file_node())) {
Logger::error("Failed to load goods!");