- extended give and take cheat's arguments to full integers.

This commit is contained in:
Christoph Oelckers 2017-01-29 11:45:28 +01:00
parent 8e469c1343
commit a2a1d214c0
3 changed files with 9 additions and 9 deletions

View file

@ -404,9 +404,9 @@ CCMD (give)
Net_WriteByte (DEM_GIVECHEAT); Net_WriteByte (DEM_GIVECHEAT);
Net_WriteString (argv[1]); Net_WriteString (argv[1]);
if (argv.argc() > 2) if (argv.argc() > 2)
Net_WriteWord (clamp (atoi (argv[2]), 1, 32767)); Net_WriteLong(atoi(argv[2]));
else else
Net_WriteWord (0); Net_WriteLong(0);
} }
CCMD (take) CCMD (take)
@ -417,9 +417,9 @@ CCMD (take)
Net_WriteByte (DEM_TAKECHEAT); Net_WriteByte (DEM_TAKECHEAT);
Net_WriteString (argv[1]); Net_WriteString (argv[1]);
if (argv.argc() > 2) if (argv.argc() > 2)
Net_WriteWord (clamp (atoi (argv[2]), 1, 32767)); Net_WriteLong(atoi (argv[2]));
else else
Net_WriteWord (0); Net_WriteLong (0);
} }
CCMD (gameversion) CCMD (gameversion)

View file

@ -2198,12 +2198,12 @@ void Net_DoCommand (int type, BYTE **stream, int player)
case DEM_GIVECHEAT: case DEM_GIVECHEAT:
s = ReadString (stream); s = ReadString (stream);
cht_Give (&players[player], s, ReadWord (stream)); cht_Give (&players[player], s, ReadLong (stream));
break; break;
case DEM_TAKECHEAT: case DEM_TAKECHEAT:
s = ReadString (stream); s = ReadString (stream);
cht_Take (&players[player], s, ReadWord (stream)); cht_Take (&players[player], s, ReadLong (stream));
break; break;
case DEM_WARPCHEAT: case DEM_WARPCHEAT:
@ -2721,7 +2721,7 @@ void Net_SkipCommand (int type, BYTE **stream)
case DEM_GIVECHEAT: case DEM_GIVECHEAT:
case DEM_TAKECHEAT: case DEM_TAKECHEAT:
skip = strlen ((char *)(*stream)) + 3; skip = strlen ((char *)(*stream)) + 5;
break; break;
case DEM_SUMMON2: case DEM_SUMMON2:

View file

@ -306,12 +306,12 @@ float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity)
} }
else if (sectorfogdensity != 0) else if (sectorfogdensity != 0)
{ {
// case 2: Sector has an explicit fog density set. // case 1: Sector has an explicit fog density set.
density = sectorfogdensity; density = sectorfogdensity;
} }
else if ((fogcolor.d & 0xffffff) == 0) else if ((fogcolor.d & 0xffffff) == 0)
{ {
// case 1: black fog // case 2: black fog
if (glset.lightmode != 8) if (glset.lightmode != 8)
{ {
density = distfogtable[glset.lightmode != 0][gl_ClampLight(lightlevel)]; density = distfogtable[glset.lightmode != 0][gl_ClampLight(lightlevel)];