diff options
author | Hop311 <Hop3114@gmail.com> | 2024-10-31 21:20:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-31 21:20:11 +0100 |
commit | 968c60580997d26035496cc675138e580354332f (patch) | |
tree | a0340ae5e92e219c5e0f5ddc825e28465f22a29e /src/openvic-simulation/misc/SongChance.cpp | |
parent | c6f7c8047abbe0a91b2a88365eee2259d8a91a65 (diff) | |
parent | 84deeffe04d730064e89b4ceaf508f3f30113ea9 (diff) |
Merge pull request #218 from OpenVicProject/condition-scripts-prep-work
Condition scripts prep work
Diffstat (limited to 'src/openvic-simulation/misc/SongChance.cpp')
-rw-r--r-- | src/openvic-simulation/misc/SongChance.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/openvic-simulation/misc/SongChance.cpp b/src/openvic-simulation/misc/SongChance.cpp index 94fb571..d05afdf 100644 --- a/src/openvic-simulation/misc/SongChance.cpp +++ b/src/openvic-simulation/misc/SongChance.cpp @@ -17,12 +17,14 @@ bool SongChanceManager::load_songs_file(ast::NodeCPtr root) { ret &= expect_dictionary_reserve_length( song_chances, [this](std::string_view key, ast::NodeCPtr value) -> bool { + using enum scope_type_t; + if (key != "song") { Logger::error("Invalid song declaration ", key); return false; } std::string_view name {}; - ConditionalWeight chance { scope_t::COUNTRY, scope_t::COUNTRY, scope_t::NO_SCOPE }; + ConditionalWeight chance { COUNTRY, COUNTRY, NO_SCOPE }; bool ret = expect_dictionary_keys( "name", ONE_EXACTLY, expect_string(assign_variable_callback(name)), |