Avoid crashing when checklines are incorrect
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8818 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -41,7 +41,10 @@ public:
|
||||
void reset(const Track &track);
|
||||
/** Returns the nth. check structure. */
|
||||
CheckStructure *getCheckStructure(unsigned int n)
|
||||
{ return m_all_checks[n]; }
|
||||
{
|
||||
if (n >= m_all_checks.size()) return NULL;
|
||||
return m_all_checks[n];
|
||||
}
|
||||
}; // CheckManager
|
||||
|
||||
#endif
|
||||
|
||||
@@ -129,6 +129,8 @@ void CheckStructure::changeStatus(const std::vector<int> indices,
|
||||
{
|
||||
CheckStructure *cs =
|
||||
m_check_manager->getCheckStructure(indices[i]);
|
||||
if (cs == NULL) continue;
|
||||
|
||||
switch(change_state)
|
||||
{
|
||||
case CS_DEACTIVATE:
|
||||
|
||||
Reference in New Issue
Block a user