Skip to content

Commit 41aa4e8

Browse files
committed
Added asserts for EXTERNAL_GLOBAL_DECLARE
1 parent 7a82ad6 commit 41aa4e8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

game/source/hs/hs_globals_external.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ enum : int16
5757
};
5858

5959
#define EXTERNAL_GLOBAL_DECLARE(NAME, TYPE, VALUE, ...) \
60+
static_assert(#VALUE[0] == '&'); \
6061
static hs_global_external NAME##_definition \
6162
{ \
6263
.name = #NAME, \
@@ -65,6 +66,7 @@ static hs_global_external NAME##_definition \
6566
}
6667

6768
#define EXTERNAL_GLOBAL_DECLARE2(NAME, TYPE, VALUE_ADDRESS, ...) \
69+
static_assert((#VALUE_ADDRESS[0] == '0' && #VALUE_ADDRESS[1] == 'x') || (#VALUE_ADDRESS[0] == 'N' && #VALUE_ADDRESS[1] == 'U' && #VALUE_ADDRESS[2] == 'L' && #VALUE_ADDRESS[3] == 'L')); \
6870
static hs_global_external NAME##_definition = \
6971
{ \
7072
.name = #NAME, \
@@ -1074,10 +1076,10 @@ EXTERNAL_GLOBAL_DECLARE(
10741076
_hs_type_boolean,
10751077
&render_water_tessllation_on,
10761078
);
1077-
EXTERNAL_GLOBAL_DECLARE2(
1079+
EXTERNAL_GLOBAL_DECLARE(
10781080
render_water_wireframe,
10791081
_hs_type_boolean,
1080-
render_water_wireframe_enabled,
1082+
&render_water_wireframe_enabled,
10811083
);
10821084
EXTERNAL_GLOBAL_DECLARE(
10831085
render_water_interaction,
@@ -5784,10 +5786,10 @@ EXTERNAL_GLOBAL_DECLARE2(
57845786
_hs_type_boolean,
57855787
NULL, // $TODO write the global chuckle nuts
57865788
);
5787-
EXTERNAL_GLOBAL_DECLARE2(
5789+
EXTERNAL_GLOBAL_DECLARE(
57885790
debug_animation_fp_sprint_disable,
57895791
_hs_type_boolean,
5790-
debug_animation_fp_sprint_disable,
5792+
&debug_animation_fp_sprint_disable,
57915793
);
57925794
EXTERNAL_GLOBAL_DECLARE2(
57935795
biped_fitting_root_offset_enable,

0 commit comments

Comments
 (0)