1953: Fix crash when switch (un)deep number is 0 r=def- a=12pm



Co-authored-by: 12pm <30786226+12pm@users.noreply.github.com>
This commit is contained in:
bors[bot] 2019-10-27 15:32:20 +00:00 committed by GitHub
commit 45cfebc5e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -818,11 +818,11 @@ void CCharacter::HandleTiles(int Index)
if(Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
Freeze(Collision()->GetSwitchDelay(MapIndex));
}
else if(Collision()->IsSwitch(MapIndex) == TILE_DFREEZE && Team() != TEAM_SUPER && Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
else if(Collision()->IsSwitch(MapIndex) == TILE_DFREEZE && Team() != TEAM_SUPER && (Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]))
{
m_DeepFreeze = true;
}
else if(Collision()->IsSwitch(MapIndex) == TILE_DUNFREEZE && Team() != TEAM_SUPER && Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()])
else if(Collision()->IsSwitch(MapIndex) == TILE_DUNFREEZE && Team() != TEAM_SUPER && (Collision()->GetSwitchNumber(MapIndex) == 0 || Collision()->m_pSwitchers[Collision()->GetSwitchNumber(MapIndex)].m_Status[Team()]))
{
m_DeepFreeze = false;
}