mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-03 15:32:45 +00:00
Moved strlen(w_chat) out of the loop.
This commit is contained in:
parent
ed3b69ff7f
commit
44e6bb8df3
1 changed files with 3 additions and 2 deletions
|
|
@ -1523,6 +1523,7 @@ static void HU_DrawChat(void)
|
||||||
INT32 charwidth = 4, charheight = 6;
|
INT32 charwidth = 4, charheight = 6;
|
||||||
INT32 t = 0, c = 0, y = chaty - (typelines*charheight) - (cv_kartspeedometer.value ? 16 : 0);
|
INT32 t = 0, c = 0, y = chaty - (typelines*charheight) - (cv_kartspeedometer.value ? 16 : 0);
|
||||||
UINT32 i = 0;
|
UINT32 i = 0;
|
||||||
|
INT32 saylen = strlen(w_chat); // You learn new things everyday!
|
||||||
const char *ntalk = "Say: ", *ttalk = "Team: ";
|
const char *ntalk = "Say: ", *ttalk = "Team: ";
|
||||||
const char *talk = ntalk;
|
const char *talk = ntalk;
|
||||||
|
|
||||||
|
|
@ -1538,7 +1539,7 @@ static void HU_DrawChat(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
|
V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT);
|
||||||
|
|
||||||
while (talk[i])
|
while (talk[i])
|
||||||
{
|
{
|
||||||
if (talk[i] < HU_FONTSTART)
|
if (talk[i] < HU_FONTSTART)
|
||||||
|
|
@ -1565,7 +1566,7 @@ static void HU_DrawChat(void)
|
||||||
if (hu_tick < 4)
|
if (hu_tick < 4)
|
||||||
V_DrawChatCharacter(cursorx, cursory+1, '_' |V_SNAPTOBOTTOM|V_SNAPTOLEFT|t, !cv_allcaps.value, NULL);
|
V_DrawChatCharacter(cursorx, cursory+1, '_' |V_SNAPTOBOTTOM|V_SNAPTOLEFT|t, !cv_allcaps.value, NULL);
|
||||||
|
|
||||||
if (cursorx == chatx+1 && strlen(w_chat) == i) // a weirdo hack
|
if (cursorx == chatx+1 && saylen == i) // a weirdo hack
|
||||||
{
|
{
|
||||||
typelines += 1;
|
typelines += 1;
|
||||||
skippedline = true;
|
skippedline = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue