From a2a1d214c0bab6d9fbc564d7c4026a409608ac25 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 29 Jan 2017 11:45:28 +0100 Subject: [PATCH] - extended give and take cheat's arguments to full integers. --- src/c_cmds.cpp | 8 ++++---- src/d_net.cpp | 6 +++--- src/gl/renderer/gl_lightdata.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index be4944b8c9..46ab072f21 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -404,9 +404,9 @@ CCMD (give) Net_WriteByte (DEM_GIVECHEAT); Net_WriteString (argv[1]); if (argv.argc() > 2) - Net_WriteWord (clamp (atoi (argv[2]), 1, 32767)); + Net_WriteLong(atoi(argv[2])); else - Net_WriteWord (0); + Net_WriteLong(0); } CCMD (take) @@ -417,9 +417,9 @@ CCMD (take) Net_WriteByte (DEM_TAKECHEAT); Net_WriteString (argv[1]); if (argv.argc() > 2) - Net_WriteWord (clamp (atoi (argv[2]), 1, 32767)); + Net_WriteLong(atoi (argv[2])); else - Net_WriteWord (0); + Net_WriteLong (0); } CCMD (gameversion) diff --git a/src/d_net.cpp b/src/d_net.cpp index 6e1d4436ed..93f6a621b7 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2198,12 +2198,12 @@ void Net_DoCommand (int type, BYTE **stream, int player) case DEM_GIVECHEAT: s = ReadString (stream); - cht_Give (&players[player], s, ReadWord (stream)); + cht_Give (&players[player], s, ReadLong (stream)); break; case DEM_TAKECHEAT: s = ReadString (stream); - cht_Take (&players[player], s, ReadWord (stream)); + cht_Take (&players[player], s, ReadLong (stream)); break; case DEM_WARPCHEAT: @@ -2721,7 +2721,7 @@ void Net_SkipCommand (int type, BYTE **stream) case DEM_GIVECHEAT: case DEM_TAKECHEAT: - skip = strlen ((char *)(*stream)) + 3; + skip = strlen ((char *)(*stream)) + 5; break; case DEM_SUMMON2: diff --git a/src/gl/renderer/gl_lightdata.cpp b/src/gl/renderer/gl_lightdata.cpp index b0dccbcba3..ae7f2a80dc 100644 --- a/src/gl/renderer/gl_lightdata.cpp +++ b/src/gl/renderer/gl_lightdata.cpp @@ -306,12 +306,12 @@ float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity) } else if (sectorfogdensity != 0) { - // case 2: Sector has an explicit fog density set. + // case 1: Sector has an explicit fog density set. density = sectorfogdensity; } else if ((fogcolor.d & 0xffffff) == 0) { - // case 1: black fog + // case 2: black fog if (glset.lightmode != 8) { density = distfogtable[glset.lightmode != 0][gl_ClampLight(lightlevel)];