Fix CMoneyMessages::RegisterOne
This commit is contained in:
parent
9938d04ca7
commit
ff665fe27f
@ -1091,21 +1091,21 @@ CMoneyMessages::Render()
|
|||||||
void
|
void
|
||||||
CMoneyMessages::RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 bGreen, uint8 bBlue, float fSize, float fOpacity)
|
CMoneyMessages::RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 bGreen, uint8 bBlue, float fSize, float fOpacity)
|
||||||
{
|
{
|
||||||
uint32 nIndex = 0;
|
uint32 i;
|
||||||
while (aMoneyMessages[nIndex].m_nTimeRegistered != 0) {
|
for(i = 0; i < NUMMONEYMESSAGES; i++)
|
||||||
if (++nIndex >= NUMMONEYMESSAGES) return;
|
if(aMoneyMessages[i].m_nTimeRegistered != 0) break;
|
||||||
}
|
if(i == NUMMONEYMESSAGES) return;
|
||||||
|
|
||||||
// Add data of this money message to the array
|
// Add data of this money message to the array
|
||||||
AsciiToUnicode(pText, aMoneyMessages[nIndex].m_aText);
|
AsciiToUnicode(pText, aMoneyMessages[i].m_aText);
|
||||||
|
|
||||||
aMoneyMessages[nIndex].m_nTimeRegistered = CTimer::GetTimeInMilliseconds();
|
aMoneyMessages[i].m_nTimeRegistered = CTimer::GetTimeInMilliseconds();
|
||||||
aMoneyMessages[nIndex].m_vecPosition = vecPos;
|
aMoneyMessages[i].m_vecPosition = vecPos;
|
||||||
aMoneyMessages[nIndex].m_Colour.red = bRed;
|
aMoneyMessages[i].m_Colour.red = bRed;
|
||||||
aMoneyMessages[nIndex].m_Colour.green = bGreen;
|
aMoneyMessages[i].m_Colour.green = bGreen;
|
||||||
aMoneyMessages[nIndex].m_Colour.blue = bBlue;
|
aMoneyMessages[i].m_Colour.blue = bBlue;
|
||||||
aMoneyMessages[nIndex].m_fSize = fSize;
|
aMoneyMessages[i].m_fSize = fSize;
|
||||||
aMoneyMessages[nIndex].m_fOpacity = fOpacity;
|
aMoneyMessages[i].m_fOpacity = fOpacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
CRGBA FoamColour(255, 255, 255, 255);
|
CRGBA FoamColour(255, 255, 255, 255);
|
||||||
|
Loading…
Reference in New Issue
Block a user