summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFilip Gawin <filip.gawin@zoho.com>2020-12-31 22:06:39 +0100
committerFilip Gawin <filip.gawin@zoho.com>2020-12-31 22:06:39 +0100
commita0a3a095ac14967b63888418d5450f5902f1b5c2 (patch)
tree2f365e77f34fd409879e4525b09020e8904d1d06 /src
parentFix CMoneyMessages::RegisterOne (diff)
downloadre3-a0a3a095ac14967b63888418d5450f5902f1b5c2.tar
re3-a0a3a095ac14967b63888418d5450f5902f1b5c2.tar.gz
re3-a0a3a095ac14967b63888418d5450f5902f1b5c2.tar.bz2
re3-a0a3a095ac14967b63888418d5450f5902f1b5c2.tar.lz
re3-a0a3a095ac14967b63888418d5450f5902f1b5c2.tar.xz
re3-a0a3a095ac14967b63888418d5450f5902f1b5c2.tar.zst
re3-a0a3a095ac14967b63888418d5450f5902f1b5c2.zip
Diffstat (limited to 'src')
-rw-r--r--src/render/SpecialFX.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp
index 0f121c1e..e17caa97 100644
--- a/src/render/SpecialFX.cpp
+++ b/src/render/SpecialFX.cpp
@@ -1385,20 +1385,24 @@ void
CMoneyMessages::RegisterOne(CVector vecPos, const char *pText, uint8 bRed, uint8 bGreen, uint8 bBlue, float fSize, float fOpacity)
{
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[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;
+#ifdef FIX_BUGS
+ for(i = 0; i < NUMMONEYMESSAGES && aMoneyMessages[i].m_nTimeRegistered != 0; i++);
+#else
+ for(i = 0; aMoneyMessages[i].m_nTimeRegistered != 0 && i < NUMMONEYMESSAGES; i++);
+#endif
+
+ if(i < NUMMONEYMESSAGES) {
+ // Add data of this money message to the array
+ 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);