Skip to content

Commit 9a03666

Browse files
committed
Fix has_building parse special callback on Linux
1 parent 403ea2d commit 9a03666

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/openvic-simulation/scripts/Condition.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,18 @@ static bool _parse_condition_node_special_callback_country(
378378
return false;
379379
}
380380

381+
static bool _parse_condition_node_special_callback_building_type_type(
382+
Condition const& condition, DefinitionManager const& definition_manager, callback_t<argument_t&&> callback,
383+
std::string_view str, bool& ret
384+
) {
385+
if (definition_manager.get_economy_manager().get_building_type_manager().get_building_type_types().contains(str)) {
386+
ret = callback(std::string { str });
387+
return true;
388+
}
389+
390+
return false;
391+
}
392+
381393
template<typename T>
382394
concept IsValidArgument =
383395
// Value arguments
@@ -2688,21 +2700,7 @@ bool ConditionManager::setup_conditions(DefinitionManager const& definition_mana
26882700
ret &= add_condition(
26892701
"has_building",
26902702
_parse_condition_node_value_callback<
2691-
BuildingType const*, PROVINCE,
2692-
+[](
2693-
Condition const& condition, DefinitionManager const& definition_manager, callback_t<argument_t&&> callback,
2694-
std::string_view str, bool& ret
2695-
) -> bool {
2696-
if (
2697-
definition_manager.get_economy_manager().get_building_type_manager().get_building_type_types()
2698-
.contains(str)
2699-
) {
2700-
ret = callback(std::string { str });
2701-
return true;
2702-
}
2703-
2704-
return false;
2705-
}
2703+
BuildingType const*, PROVINCE, _parse_condition_node_special_callback_building_type_type
27062704
>,
27072705
_execute_condition_node_unimplemented
27082706
);

0 commit comments

Comments
 (0)