danreeves / darktide-mods

11 stars 9 forks source link

handle nil value mechanism #63

Closed deluxghost closed 1 year ago

deluxghost commented 1 year ago

It happened during a network failure, which might mess up the game state machine. Anyway this mod should not crash just because this

<<Script Error>>[string "./../mods/NumericUI/scripts/mods/NumericUI/Mi..."]:57: attempt to index field '_mechanism' (a nil value)<</Script Error>>
<<Lua Stack>>  [1] ./../mods/NumericUI/scripts/mods/NumericUI/MissionIntroView.lua:57: in function draw_mission_title
  [2] ./../mods/NumericUI/scripts/mods/NumericUI/MissionIntroView.lua:103: in function hook_chain
  [3] ./../mods/dmf/scripts/mods/dmf/modules/core/hooks.lua:184: in function draw
  [4] @scripts/managers/ui/ui_view_handler.lua:613: in function _draw_views
  [5] @scripts/managers/ui/ui_view_handler.lua:322: in function draw
  [6] @scripts/managers/ui/ui_manager.lua:867: in function render
  [7] @scripts/game_states/state_game.lua:813: in function render
  [8] @scripts/foundation/utilities/game_state_machine.lua:105: in function render
  [9] ./mod_loader:392: in function render
  [10] ./mod_loader:438:in function <[string "./mod_loader"]:437>
<</Lua Stack>>
<<Lua Locals>>  [1] self = table: 00000000061E45C0
  [2] self = table: 00000000061E45C0; dt = 0.01666669994443298; t = 227.66148046506964; input_service = table: 0000000003BA3050; layer = 1
  [3] hook_chain = [function]
  [4] self = table: 0000000002DDF7D0; dt = 0.01666669994443298; t = 227.66148046506964; allow_input = true; transitioning_in = false; transitioning_out = false; active_views_array = table: 0000000002DDF8E0; active_views_data = table: 0000000002DE0770; input_service = table: 0000000003BA3050; null_service = table: 0000000003BB22F0; gamepad_active = false; allow_draw = true; layers_per_view = 50; top_draw_layer = 0; num_active_views = 1; i = 1; view_name = "mission_intro_view"; view_data = table: 0000000006E22960; can_draw_view = true; draw_view = true; view_instance = table: 00000000061E45C0; draw_layer = 1; input = table: 0000000003BA3050
  [5] self = table: 0000000002DDF7D0; dt = 0.01666669994443298; t = 227.66148046506964; num_active_views = 1; allow_input = true; transitioning = false; transitioning_in = false; transitioning_out = false
  [6] self = table: 0000000002DB95F0; dt = 0.01666669994443298; t = 227.66148046506964
  [7] self = table: 000000000007D8E0; t = 227.66148046506964; dt = 0.01666669994443298; ui_manager = table: 0000000002DB95F0
  [8] self = table: 0000000000183BA0
  [9] self = table: 000000000008CBE0
<</Lua Locals>>
<<Lua Self>>  [1] _render_settings = table: 0000000006A26660; _widgets_by_name = table: 0000000006A2C480; _vo_unit = [Unit '#ID[4c75c4f2a74cb287]']; _spawn_point_units = table: 00000000061E45F0; _offscreen_viewport = [Viewport]; _allow_close_hotkey = false; view_name = "mission_intro_view"; _using_cursor_navigation = true; _elements = table: 0000000006687FC0; _settings = table: 0000000003BE76F0; _offscreen_world = [World]; _should_unload = true; _world_spawner = table: 0000000006A22B60; _profile_loaders = table: 00000000060E0590; _spawn_slots = table: 0000000004793980; _pass_input = false; _definitions = table: 000000000603E300; _pass_draw = false; _world_initialized = true; _entered = true; _animation_events_used = table: 0000000006A24550; _current_vo_event = "mission_strain_briefing_a"; _can_exit = true; _current_vo_id = 213; _elements_array = table: 00000000060C93C0; _last_vo_event = "mission_strain_briefing_c"; _can_close = true; _on_enter_animation_triggered = true; done_at = 228.68739496746255; _num_animation_events_used = 1; _element_to_pivot = table: 00000000060C93F0; _render_scale = 1; _widgets = table: 0000000006A383C0; _ui_scenegraph = table: 0000000006A38360; _local_player_id = 1; _ui_offscreen_renderer = table: 00000000063E6C20; _ui_renderer = table: 00000000063E6C50; _event_list = table: 0000000006687F90; _cursor_pushed = true; _offscreen_viewport_name = "MissionIntroView_ui_offscreen_world_viewport"; _seed = 1018751487; 
  [2] _render_settings = table: 0000000006A26660; _widgets_by_name = table: 0000000006A2C480; _vo_unit = [Unit '#ID[4c75c4f2a74cb287]']; _spawn_point_units = table: 00000000061E45F0; _offscreen_viewport = [Viewport]; _allow_close_hotkey = false; view_name = "mission_intro_view"; _using_cursor_navigation = true; _elements = table: 0000000006687FC0; _settings = table: 0000000003BE76F0; _offscreen_world = [World]; _should_unload = true; _world_spawner = table: 0000000006A22B60; _profile_loaders = table: 00000000060E0590; _spawn_slots = table: 0000000004793980; _pass_input = false; _definitions = table: 000000000603E300; _pass_draw = false; _world_initialized = true; _entered = true; _animation_events_used = table: 0000000006A24550; _current_vo_event = "mission_strain_briefing_a"; _can_exit = true; _current_vo_id = 213; _elements_array = table: 00000000060C93C0; _last_vo_event = "mission_strain_briefing_c"; _can_close = true; _on_enter_animation_triggered = true; done_at = 228.68739496746255; _num_animation_events_used = 1; _element_to_pivot = table: 00000000060C93F0; _render_scale = 1; _widgets = table: 0000000006A383C0; _ui_scenegraph = table: 0000000006A38360; _local_player_id = 1; _ui_offscreen_renderer = table: 00000000063E6C20; _ui_renderer = table: 00000000063E6C50; _event_list = table: 0000000006687F90; _cursor_pushed = true; _offscreen_viewport_name = "MissionIntroView_ui_offscreen_world_viewport"; _seed = 1018751487; 
  [4] _game_world_fullscreen_blur_amount = 0; _active_views_array = table: 0000000002DDF8E0; _game_world_disabled = true; _num_active_views = 1; _active_views_data = table: 0000000002DE0770; _view_list = table: 0000000003BE3730; _drawing_views = true; _registered_view_worlds = table: 0000000002DE08A0; _transitioning = false; _timer_name = "ui"; _render_scale = 1; _curent_frame_view_layers = table: 0000000002DE14D0; _game_world_fullscreen_blur_enabled = false; _transition_ui = table: 0000000002DE1880; _any_view_using_input = true; _allow_input = true; _updating_views = false; 
  [5] _game_world_fullscreen_blur_amount = 0; _active_views_array = table: 0000000002DDF8E0; _game_world_disabled = true; _num_active_views = 1; _active_views_data = table: 0000000002DE0770; _view_list = table: 0000000003BE3730; _drawing_views = true; _registered_view_worlds = table: 0000000002DE08A0; _transitioning = false; _timer_name = "ui"; _render_scale = 1; _curent_frame_view_layers = table: 0000000002DE14D0; _game_world_fullscreen_blur_enabled = false; _transition_ui = table: 0000000002DE1880; _any_view_using_input = true; _allow_input = true; _updating_views = false; 
  [6] _active_popups = table: 000<</Lua Self>>