mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-24 04:31:11 +03:00
Fix vgui_screen crashing for existing saves until v8.0
This commit is contained in:
parent
70a13c3306
commit
10f08829e5
@ -184,6 +184,11 @@ CVGuiScreen::~CVGuiScreen()
|
|||||||
|
|
||||||
int CVGuiScreen::Save(ISave& save)
|
int CVGuiScreen::Save(ISave& save)
|
||||||
{
|
{
|
||||||
|
#if MAPBASE_VER_INT < 8000
|
||||||
|
// HACKHACK: Until v8.0, mark this screen as using the new save system to prevent existing saves with vgui_screen from crashing
|
||||||
|
AddContext( "uses_new_save", "1" );
|
||||||
|
#endif
|
||||||
|
|
||||||
int status = BaseClass::Save(save);
|
int status = BaseClass::Save(save);
|
||||||
if (!status)
|
if (!status)
|
||||||
return 0;
|
return 0;
|
||||||
@ -209,6 +214,12 @@ int CVGuiScreen::Restore(IRestore& restore)
|
|||||||
if (!status)
|
if (!status)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#if MAPBASE_VER_INT < 8000
|
||||||
|
// HACKHACK: Until v8.0, mark this screen as using the new save system to prevent existing saves with vgui_screen from crashing
|
||||||
|
if (!HasContext( "uses_new_save", "1" ))
|
||||||
|
return status;
|
||||||
|
#endif
|
||||||
|
|
||||||
const int iCount = restore.ReadInt();
|
const int iCount = restore.ReadInt();
|
||||||
m_PanelOutputs.EnsureCapacity(iCount);
|
m_PanelOutputs.EnsureCapacity(iCount);
|
||||||
for (int i = 0; i < iCount; i++)
|
for (int i = 0; i < iCount; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user