Skip to content

Commit c8c874a

Browse files
wvpmSpartan322
authored andcommitted
Fix building registry locked spam
Add initialization to IDENTIFIER_REGISTRY macro
1 parent 2b741a6 commit c8c874a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/openvic-simulation/map/ProvinceInstance.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ namespace OpenVic {
9696
memory::vector<ProvinceInstance const*> PROPERTY(adjacent_nonempty_land_provinces);
9797
Crime const* PROPERTY_RW(crime, nullptr);
9898
ResourceGatheringOperation PROPERTY(rgo);
99-
IdentifierRegistry<BuildingInstance> IDENTIFIER_REGISTRY(building);
99+
IdentifierRegistry<BuildingInstance> IDENTIFIER_REGISTRY(building, false);
100100
memory::vector<ArmyInstance*> SPAN_PROPERTY(armies);
101101
memory::vector<NavyInstance*> SPAN_PROPERTY(navies);
102102
// The number of land regiments currently in the province, including those being transported by navies

src/openvic-simulation/types/IdentifierRegistry.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -602,14 +602,14 @@ namespace OpenVic {
602602

603603
/* Macros to generate declaration and constant accessor methods for a UniqueKeyRegistry member variable. */
604604

605-
#define IDENTIFIER_REGISTRY(name) \
606-
IDENTIFIER_REGISTRY_CUSTOM_PLURAL(name, name##s)
605+
#define IDENTIFIER_REGISTRY(name, ...) \
606+
IDENTIFIER_REGISTRY_CUSTOM_PLURAL(name, name##s, __VA_ARGS__)
607607

608-
#define IDENTIFIER_REGISTRY_CUSTOM_PLURAL(singular, plural) \
609-
IDENTIFIER_REGISTRY_FULL_CUSTOM(singular, plural, plural, plural)
608+
#define IDENTIFIER_REGISTRY_CUSTOM_PLURAL(singular, plural, ...) \
609+
IDENTIFIER_REGISTRY_FULL_CUSTOM(singular, plural, plural, plural, __VA_ARGS__)
610610

611-
#define IDENTIFIER_REGISTRY_FULL_CUSTOM(singular, plural, registry, debug_name) \
612-
registry { #debug_name }; \
611+
#define IDENTIFIER_REGISTRY_FULL_CUSTOM(singular, plural, registry, debug_name, ...) \
612+
registry { #debug_name __VA_OPT__(,) __VA_ARGS__ }; \
613613
public: \
614614
constexpr void lock_##plural() { \
615615
registry.lock(); \

0 commit comments

Comments
 (0)