diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2020-12-31 21:43:53 +0100 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2020-12-31 21:43:53 +0100 |
commit | ff665fe27fe24af617773b9492f6fc08bc53a97f (patch) | |
tree | 2effe105bb895f734fb817809888fa748452d34e /src/render/SpecialFX.cpp | |
parent | Fix UB in ProjectileInfo.cpp (diff) | |
download | re3-ff665fe27fe24af617773b9492f6fc08bc53a97f.tar re3-ff665fe27fe24af617773b9492f6fc08bc53a97f.tar.gz re3-ff665fe27fe24af617773b9492f6fc08bc53a97f.tar.bz2 re3-ff665fe27fe24af617773b9492f6fc08bc53a97f.tar.lz re3-ff665fe27fe24af617773b9492f6fc08bc53a97f.tar.xz re3-ff665fe27fe24af617773b9492f6fc08bc53a97f.tar.zst re3-ff665fe27fe24af617773b9492f6fc08bc53a97f.zip |
Diffstat (limited to 'src/render/SpecialFX.cpp')
-rw-r--r-- | src/render/SpecialFX.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp index ade5db81..908b67d8 100644 --- a/src/render/SpecialFX.cpp +++ b/src/render/SpecialFX.cpp @@ -1091,21 +1091,21 @@ CMoneyMessages::Render() void CMoneyMessages::RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 bGreen, uint8 bBlue, float fSize, float fOpacity) { - uint32 nIndex = 0; - while (aMoneyMessages[nIndex].m_nTimeRegistered != 0) { - if (++nIndex >= NUMMONEYMESSAGES) return; - } + uint32 i; + for(i = 0; i < NUMMONEYMESSAGES; i++) + if(aMoneyMessages[i].m_nTimeRegistered != 0) break; + if(i == NUMMONEYMESSAGES) return; // Add data of this money message to the array - AsciiToUnicode(pText, aMoneyMessages[nIndex].m_aText); - - aMoneyMessages[nIndex].m_nTimeRegistered = CTimer::GetTimeInMilliseconds(); - aMoneyMessages[nIndex].m_vecPosition = vecPos; - aMoneyMessages[nIndex].m_Colour.red = bRed; - aMoneyMessages[nIndex].m_Colour.green = bGreen; - aMoneyMessages[nIndex].m_Colour.blue = bBlue; - aMoneyMessages[nIndex].m_fSize = fSize; - aMoneyMessages[nIndex].m_fOpacity = fOpacity; + AsciiToUnicode(pText, aMoneyMessages[i].m_aText); + + aMoneyMessages[i].m_nTimeRegistered = CTimer::GetTimeInMilliseconds(); + aMoneyMessages[i].m_vecPosition = vecPos; + aMoneyMessages[i].m_Colour.red = bRed; + aMoneyMessages[i].m_Colour.green = bGreen; + aMoneyMessages[i].m_Colour.blue = bBlue; + aMoneyMessages[i].m_fSize = fSize; + aMoneyMessages[i].m_fOpacity = fOpacity; } CRGBA FoamColour(255, 255, 255, 255); |