From 166687d971a6f0f4a596afca5e8f7ee81ca2443d Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Thu, 18 Feb 2016 00:49:08 +0100 Subject: [PATCH] - Added optional 'z' parameter to the 'warp' CCMD. Now it's possible to warp above 3dfloors. --- src/c_cmds.cpp | 5 +++-- src/d_net.cpp | 10 +++++++--- src/version.h | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index ca9ddaf6e..70f36bea9 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -777,15 +777,16 @@ CCMD (warp) Printf ("You can only warp inside a level.\n"); return; } - if (argv.argc() != 3) + if (argv.argc() < 3 || argv.argc() > 4) { - Printf ("Usage: warp \n"); + Printf ("Usage: warp [z]\n"); } else { Net_WriteByte (DEM_WARPCHEAT); Net_WriteWord (atoi (argv[1])); Net_WriteWord (atoi (argv[2])); + Net_WriteWord (argv.argc() == 3 ? ONFLOORZ/65536 : atoi (argv[3])); } } diff --git a/src/d_net.cpp b/src/d_net.cpp index 88b4372fb..774333005 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2199,10 +2199,11 @@ void Net_DoCommand (int type, BYTE **stream, int player) case DEM_WARPCHEAT: { - int x, y; + int x, y, z; x = ReadWord (stream); y = ReadWord (stream); - P_TeleportMove (players[player].mo, x * 65536, y * 65536, ONFLOORZ, true); + z = ReadWord (stream); + P_TeleportMove (players[player].mo, x * 65536, y * 65536, z * 65536, true); } break; @@ -2744,9 +2745,12 @@ void Net_SkipCommand (int type, BYTE **stream) skip = strlen ((char *)(*stream)) + 1; break; + case DEM_WARPCHEAT: + skip = 6; + break; + case DEM_INVUSE: case DEM_INVDROP: - case DEM_WARPCHEAT: skip = 4; break; diff --git a/src/version.h b/src/version.h index a585e9aec..49e99ef6a 100644 --- a/src/version.h +++ b/src/version.h @@ -61,11 +61,11 @@ const char *GetVersionString(); // Protocol version used in demos. // Bump it if you change existing DEM_ commands or add new ones. // Otherwise, it should be safe to leave it alone. -#define DEMOGAMEVERSION 0x21D +#define DEMOGAMEVERSION 0x21E // Minimum demo version we can play. // Bump it whenever you change or remove existing DEM_ commands. -#define MINDEMOVERSION 0x21D +#define MINDEMOVERSION 0x21E // SAVEVER is the version of the information stored in level snapshots. // Note that SAVEVER is not directly comparable to VERSION.