mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
PF_VarString: throttle "exceeds standard limit" warning message
Prevents console spam on "developer 1" if a mod calls PF_VarString often (e.g. In the Shadows textbooks). git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1402 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
95fca75a77
commit
eb2701a484
2 changed files with 8 additions and 1 deletions
|
@ -284,6 +284,7 @@ typedef struct {
|
|||
double packetsize;
|
||||
double efrags;
|
||||
double beams;
|
||||
double varstring;
|
||||
} overflowtimes_t;
|
||||
extern overflowtimes_t dev_overflows; //this stores the last time overflow messages were displayed, not the last time overflows occured
|
||||
#define CONSOLE_RESPAM_TIME 3 // seconds between repeated warning messages
|
||||
|
|
|
@ -65,7 +65,13 @@ static char *PF_VarString (int first)
|
|||
}
|
||||
}
|
||||
if (s > 255)
|
||||
Con_DWarning("PF_VarString: %i characters exceeds standard limit of 255 (max = %d).\n", (int) s, (int)(sizeof(out) - 1));
|
||||
{
|
||||
if (!dev_overflows.varstring || dev_overflows.varstring + CONSOLE_RESPAM_TIME < realtime)
|
||||
{
|
||||
Con_DWarning("PF_VarString: %i characters exceeds standard limit of 255 (max = %d).\n", (int) s, (int)(sizeof(out) - 1));
|
||||
dev_overflows.varstring = realtime;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue