Fixed crash when switching maps and editLights is still running. close #960

This commit is contained in:
Robert Beckebans 2025-01-18 18:02:29 +01:00
parent e0da5a7890
commit 4f778fcc9d
2 changed files with 17 additions and 0 deletions

View file

@ -1715,6 +1715,18 @@ void idGameLocal::MapShutdown()
gameRenderWorld->DebugClearPolygons( 0 ); gameRenderWorld->DebugClearPolygons( 0 );
} }
// RB: kill ingame editors to prevent crashes during shutdown
if( com_editors != 0 )
{
com_editors = 0;
g_editEntityMode.SetInteger( 0 );
// turn off light debug drawing in the render backend
r_singleLight.SetInteger( -1 );
r_showLights.SetInteger( 0 );
}
// RB end
// clear out camera if we're in a cinematic // clear out camera if we're in a cinematic
if( inCinematic ) if( inCinematic )
{ {

View file

@ -74,6 +74,11 @@ bool ReleaseMouseForTools()
void DrawToolWindows() void DrawToolWindows()
{ {
if( !AreEditorsActive() )
{
return;
}
if( LightEditor::Instance().IsShown() ) if( LightEditor::Instance().IsShown() )
{ {
LightEditor::Instance().Draw(); LightEditor::Instance().Draw();