mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Don't access switchers out of bounds (fixes #4386)
It's possible that a map was saved with a different amount of switchers than it has at the moment. Happened on Jao Shooter. I'll check with mapper if they changed the number of switchers.
This commit is contained in:
parent
c18d4f8254
commit
2e34f45c50
|
@ -528,7 +528,7 @@ void CSaveTeam::Load(int Team, bool KeepCurrentWeakStrong)
|
|||
|
||||
if(m_pController->GameServer()->Collision()->m_NumSwitchers)
|
||||
{
|
||||
for(int i = 1; i < m_pController->GameServer()->Collision()->m_NumSwitchers + 1; i++)
|
||||
for(int i = 1; i < minimum(m_NumSwitchers, m_pController->GameServer()->Collision()->m_NumSwitchers) + 1; i++)
|
||||
{
|
||||
m_pController->GameServer()->Collision()->m_pSwitchers[i].m_Status[Team] = m_pSwitchers[i].m_Status;
|
||||
if(m_pSwitchers[i].m_EndTime)
|
||||
|
|
Loading…
Reference in a new issue