Preventing redundancy of doubled messages correctly
This commit is contained in:
parent
b7c2e1cfa4
commit
a65105241b
|
@ -3,6 +3,7 @@ D1X-Rebirth Changelog
|
|||
20070826
|
||||
--------
|
||||
main/game.c, main/multi.c: Improved CPU cycles sleeping for -nicefps - moved out of main frame calc loop and taking care of 10ms timer inaccuracy
|
||||
main/hud.c: Preventing redundancy of doubled messages correctly
|
||||
|
||||
20070821
|
||||
--------
|
||||
|
|
14
main/hud.c
14
main/hud.c
|
@ -232,13 +232,17 @@ int HUD_init_message_va(char * format, va_list args)
|
|||
return 0; // ignore since it is the same as the last one
|
||||
}
|
||||
|
||||
if (strnicmp ("you",message,3)) { // block hudlog output messages beginning with you ("your ... maxed out", "you already have ...")
|
||||
t=time(NULL);
|
||||
lt=localtime(&t);
|
||||
|
||||
printf("%02i:%02i:%02i %s\n",lt->tm_hour,lt->tm_min,lt->tm_sec,message);
|
||||
// also ignore the one before the previous (i.e. "vulcan ammo maxed" "already got vulcan cannon", "vulcan ammo maxed")
|
||||
if (last_message && (!strcmp(&HUD_messages[hud_last-2][0], message))) {
|
||||
HUD_message_timer = F1_0*3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
t=time(NULL);
|
||||
lt=localtime(&t);
|
||||
|
||||
printf("%02i:%02i:%02i %s\n",lt->tm_hour,lt->tm_min,lt->tm_sec,message);
|
||||
|
||||
hud_last = temp;
|
||||
// Check if memory has been overwritten at this point.
|
||||
if (strlen(message) >= HUD_MESSAGE_LENGTH)
|
||||
|
|
Loading…
Reference in a new issue