[Custom View] Fix loading screen reloading crash
This commit is contained in:
parent
1f950de22e
commit
845ba03527
1 changed files with 4 additions and 2 deletions
|
@ -114,7 +114,7 @@ end
|
||||||
|
|
||||||
local function remove_injected_views(on_reload)
|
local function remove_injected_views(on_reload)
|
||||||
-- These elements should be removed only on_reload, because, otherwise, they will be deleted automatically.
|
-- These elements should be removed only on_reload, because, otherwise, they will be deleted automatically.
|
||||||
if on_reload and _ingame_ui then
|
if on_reload then
|
||||||
-- If some custom view is active, close it.
|
-- If some custom view is active, close it.
|
||||||
if _views_data[_ingame_ui.current_view] then
|
if _views_data[_ingame_ui.current_view] then
|
||||||
_ingame_ui:handle_transition("exit_menu")
|
_ingame_ui:handle_transition("exit_menu")
|
||||||
|
@ -350,7 +350,9 @@ end)
|
||||||
-- #####################################################################################################################
|
-- #####################################################################################################################
|
||||||
|
|
||||||
function vmf.remove_custom_views()
|
function vmf.remove_custom_views()
|
||||||
|
if _ingame_ui then
|
||||||
remove_injected_views(true)
|
remove_injected_views(true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue