mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-23 07:36:16 +00:00
Fixed: Don't put same twice frequencies in list
This commit is contained in:
parent
b0916cf1de
commit
ff9cf5b95b
1 changed files with 20 additions and 4 deletions
|
@ -1477,14 +1477,30 @@ bool getRyzomModes(std::vector<NL3D::UDriver::CMode> &videoModes, std::vector<st
|
||||||
if (videoModes[i].Width == videoModes[nFoundMode].Width && videoModes[i].Height == videoModes[nFoundMode].Height)
|
if (videoModes[i].Width == videoModes[nFoundMode].Width && videoModes[i].Height == videoModes[nFoundMode].Height)
|
||||||
{
|
{
|
||||||
uint freq = videoModes[i].Frequency;
|
uint freq = videoModes[i].Frequency;
|
||||||
|
std::string freqStr = toString(freq);
|
||||||
|
|
||||||
|
bool bFound = false;
|
||||||
|
|
||||||
|
// check if frequency already found in list
|
||||||
|
for (j = 0; j < (sint)stringFreqList.size(); ++j)
|
||||||
|
{
|
||||||
|
if (stringFreqList[j] == freqStr)
|
||||||
|
{
|
||||||
|
bFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bFound)
|
||||||
|
{
|
||||||
// if frequency is 0, take the first one else use the exact one
|
// if frequency is 0, take the first one else use the exact one
|
||||||
if (nFoundStringFreq == -1 && ((ClientCfg.Frequency == 0) || (freq == ClientCfg.Frequency)))
|
if (nFoundStringFreq == -1 && ((ClientCfg.Frequency == 0) || (freq == ClientCfg.Frequency)))
|
||||||
{
|
{
|
||||||
nFoundStringFreq = stringFreqList.size();
|
nFoundStringFreq = stringFreqList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
stringFreqList.push_back(toString(freq));
|
stringFreqList.push_back(freqStr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue