mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
3129: Editor: Fix selection of None value in auto rules (fixes #3013) r=Jupeyy a=def- by starting the indexing at 0 3138: Fix out of bounds access in GetSolo r=Jupeyy a=def- As discovered in #3135 3143: Ignore ddnet-info.json dl failure again r=Jupeyy a=def- too aggressive, might just be bad internet at the moment Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
commit
aca143cb7d
|
@ -2874,7 +2874,6 @@ void CClient::Update()
|
|||
FinishDDNetInfo();
|
||||
else if(m_pDDNetInfoTask->State() == HTTP_ERROR)
|
||||
{
|
||||
m_Warnings.emplace_back(SWarning(Localize("Downloading ddnet-info.json failed")));
|
||||
Storage()->RemoveFile(m_aDDNetInfoTmp, IStorage::TYPE_SAVE);
|
||||
ResetDDNetInfo();
|
||||
}
|
||||
|
|
|
@ -1490,7 +1490,7 @@ int CEditor::PopupSelectConfigAutoMap(CEditor *pEditor, CUIRect View, void *pCon
|
|||
|
||||
pEditor->UI()->ClipEnable(&View);
|
||||
|
||||
for(int i = -1; i < pAutoMapper->ConfigNamesNum(); i++)
|
||||
for(int i = 0; i < pAutoMapper->ConfigNamesNum() + 1; i++)
|
||||
{
|
||||
if(ListCur > ListStopAt)
|
||||
break;
|
||||
|
@ -1499,8 +1499,10 @@ int CEditor::PopupSelectConfigAutoMap(CEditor *pEditor, CUIRect View, void *pCon
|
|||
{
|
||||
View.HSplitTop(ButtonMargin, 0, &View);
|
||||
View.HSplitTop(ButtonHeight, &Button, &View);
|
||||
if(pEditor->DoButton_MenuItem(&s_AutoMapperConfigButtons[i], i == -1 ? "None" : pAutoMapper->GetConfigName(i), i == s_AutoMapConfigCurrent, &Button, 0, 0))
|
||||
if(pEditor->DoButton_MenuItem(&s_AutoMapperConfigButtons[i], i == 0 ? "None" : pAutoMapper->GetConfigName(i - 1), i == s_AutoMapConfigCurrent, &Button, 0, 0))
|
||||
{
|
||||
s_AutoMapConfigSelected = i;
|
||||
}
|
||||
}
|
||||
ListCur += ButtonHeight + ButtonMargin;
|
||||
}
|
||||
|
@ -1530,7 +1532,7 @@ int CEditor::PopupSelectConfigAutoMapResult()
|
|||
|
||||
s_AutoMapConfigCurrent = s_AutoMapConfigSelected;
|
||||
s_AutoMapConfigSelected = -100;
|
||||
return s_AutoMapConfigCurrent;
|
||||
return s_AutoMapConfigCurrent - 1;
|
||||
}
|
||||
|
||||
// DDRace
|
||||
|
|
|
@ -37,6 +37,8 @@ public:
|
|||
|
||||
bool GetSolo(int ClientID) const
|
||||
{
|
||||
if(ClientID < 0 || ClientID >= MAX_CLIENTS)
|
||||
return false;
|
||||
return m_IsSolo[ClientID];
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue