Changed stage stats assert on ScreenEvaluation to give a more informative message and avoid crashing.

This commit is contained in:
Kyzentun Keeslala
2015-10-22 18:12:37 -06:00
parent 500300d337
commit 264ba550b7
+5 -1
View File
@@ -219,7 +219,11 @@ void ScreenEvaluation::Init()
}
}
ASSERT_M( !STATSMAN->m_vPlayedStageStats.empty(), "PlayerStageStats is empty!" );
if(STATSMAN->m_vPlayedStageStats.empty())
{
LuaHelpers::ReportScriptError("PlayerStageStats is empty! Do not use SM_GoToNextScreen on ScreenGameplay, use SM_DoNextScreen instead so that ScreenGameplay can clean up properly.");
STATSMAN->m_vPlayedStageStats.push_back(STATSMAN->m_CurStageStats);
}
m_pStageStats = &STATSMAN->m_vPlayedStageStats.back();
ZERO( m_bSavedScreenshot );