mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Check array boundary for shape type
This commit is contained in:
parent
82eba3875d
commit
5f4067c483
|
@ -635,6 +635,8 @@ int CEditor::PopupSource(CEditor *pEditor, CUIRect View)
|
|||
"Circle"
|
||||
};
|
||||
|
||||
pSource->m_Shape.m_Type = pSource->m_Shape.m_Type%CSoundShape::NUM_SHAPES; // prevent out of array errors
|
||||
|
||||
if(pEditor->DoButton_Editor(&s_ShapeTypeButton, s_aShapeNames[pSource->m_Shape.m_Type], 0, &ShapeButton, 0, "Change shape"))
|
||||
{
|
||||
pSource->m_Shape.m_Type = (pSource->m_Shape.m_Type+1)%CSoundShape::NUM_SHAPES;
|
||||
|
|
Loading…
Reference in a new issue