Skip to content

Commit 4ba2ff0

Browse files
committed
Fixed crash issue caused by globals
1 parent 413bdb9 commit 4ba2ff0

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

game/source/hs/hs_globals_external.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "main/main_game.hpp"
2323
#include "main/main_render.hpp"
2424
#include "main/main_time.hpp"
25+
#include "memory/module.hpp"
2526
#include "motor/sync_action.hpp"
2627
#include "networking/logic/life_cycle/life_cycle_handler_pre_game.hpp"
2728
#include "networking/messages/network_message_gateway.hpp"
@@ -50,6 +51,10 @@
5051
#include "units/bipeds.hpp"
5152
#include "visibility/visibility_collection.hpp"
5253

54+
// $TODO we don't fully own all the places `k_hs_external_global_count` is used yet
55+
const t_value_type<int16> k_hs_external_global_count_data = { .value = k_hs_external_global_count };
56+
DATA_PATCH_DECLARE(0x0167B188, k_hs_external_global_count, k_hs_external_global_count_data.bytes);
57+
5358
enum : int16
5459
{
5560
k_maximum_number_of_ms23_hs_globals = 1315
@@ -6866,7 +6871,6 @@ static hs_global_external* const hs_external_globals[]
68666871
&chud_debug_crosshair_definition,
68676872
&chud_debug_metagame_definition,
68686873
&debug_unit_all_animations_definition,
6869-
&debug_enable_force_phonebooth_assassinate_definition,
68706874
&debug_unit_animations_definition,
68716875
&debug_unit_illumination_definition,
68726876
&debug_unit_active_camo_frequency_modulator_definition,
@@ -6905,11 +6909,6 @@ static hs_global_external* const hs_external_globals[]
69056909
&sound_global_room_gain_definition,
69066910
&sound_direct_path_gain_definition,
69076911
&enable_pc_sound_definition,
6908-
&debug_sound_definition,
6909-
&debug_sound_manager_channels_definition,
6910-
&debug_sound_timing_definition,
6911-
&debug_duckers_definition,
6912-
&debug_sound_listeners_definition,
69136912
&unknown82_definition,
69146913
&unknown83_definition,
69156914
&unknown84_definition,
@@ -7004,7 +7003,6 @@ static hs_global_external* const hs_external_globals[]
70047003
&render_debug_force_cinematic_lights_definition,
70057004
&render_debug_pix_events_definition,
70067005
&render_atmosphere_cluster_blend_data_definition,
7007-
&render_debug_display_command_buffer_data_definition,
70087006
&render_debug_screen_shaders_definition,
70097007
&render_debug_screen_effects_definition,
70107008
&render_screen_effects_definition,
@@ -7343,15 +7341,12 @@ static hs_global_external* const hs_external_globals[]
73437341
&debug_plane_index_definition,
73447342
&debug_surface_index_definition,
73457343
&debug_input_definition,
7346-
&debug_input_abstraction_definition,
7347-
&debug_input_mouse_state_definition,
73487344
&debug_leaf0_index_definition,
73497345
&debug_leaf1_index_definition,
73507346
&debug_leaf_connection_index_definition,
73517347
&debug_cluster_index_definition,
73527348
&debug_first_person_weapons_definition,
73537349
&debug_first_person_models_definition,
7354-
&debug_first_person_skeleton_definition,
73557350
&breakable_surfaces_definition,
73567351
&debug_lights_definition,
73577352
&debug_light_passes_definition,
@@ -7916,7 +7911,6 @@ static hs_global_external* const hs_external_globals[]
79167911
&animation_throttle_dampening_scale_definition,
79177912
&animation_blend_change_scale_definition,
79187913
&biped_fitting_enable_definition,
7919-
&debug_animation_fp_sprint_disable_definition,
79207914
&biped_fitting_root_offset_enable_definition,
79217915
&biped_pivot_enable_definition,
79227916
&biped_pivot_allow_player_definition,
@@ -8106,6 +8100,17 @@ static hs_global_external* const hs_external_globals[]
81068100
&debug_weapons_magazines_definition,
81078101
&debug_weapons_primary_definition,
81088102
&debug_weapons_secondary_definition,
8103+
&debug_enable_force_phonebooth_assassinate_definition,
8104+
&debug_sound_definition,
8105+
&debug_sound_manager_channels_definition,
8106+
&debug_sound_timing_definition,
8107+
&debug_duckers_definition,
8108+
&debug_sound_listeners_definition,
8109+
&render_debug_display_command_buffer_data_definition,
8110+
&debug_input_abstraction_definition,
8111+
&debug_input_mouse_state_definition,
8112+
&debug_first_person_skeleton_definition,
8113+
&debug_animation_fp_sprint_disable_definition,
81098114
&static_fp_fov_definition,
81108115
&centered_crosshair_definition,
81118116
&mean_look_sensitivity_definition,

0 commit comments

Comments
 (0)