git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6712
d7cf8633-e32d-0410-b094-
e92efae38249
if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN<<i) )
{
time = cl.item_gettime[i];
if (cl.stats[STAT_ITEMS] & (IT_SHOTGUN<<i) )
{
time = cl.item_gettime[i];
- flashon = (int)((cl.time - time)*10);
+ flashon = (int)(max(0, cl.time - time)*10);
if (flashon >= 10)
{
if ( cl.stats[STAT_ACTIVEWEAPON] == (IT_SHOTGUN<<i) )
if (flashon >= 10)
{
if ( cl.stats[STAT_ACTIVEWEAPON] == (IT_SHOTGUN<<i) )
{
if (cl.stats[STAT_ITEMS] & (1<<hipweapons[i]) )
{
{
if (cl.stats[STAT_ITEMS] & (1<<hipweapons[i]) )
{
- time = cl.item_gettime[hipweapons[i]];
+ time = max(0, cl.item_gettime[hipweapons[i]]);
flashon = (int)((cl.time - time)*10);
if (flashon >= 10)
{
flashon = (int)((cl.time - time)*10);
if (flashon >= 10)
{
int redflag, blueflag;
// we have a max time 2s (min time = 0)
int redflag, blueflag;
// we have a max time 2s (min time = 0)
- if ((time = cl.time - cl.weapontime) < 2)
+ if ((time = max(0, cl.time - cl.weapontime)) < 2)
{
fade = (1.0 - 0.5 * time);
fade *= fade;
{
fade = (1.0 - 0.5 * time);
fade *= fade;