- Added optional 'z' parameter to the 'warp' CCMD.

Now it's possible to warp above 3dfloors.
This commit is contained in:
Edoardo Prezioso 2016-02-18 00:49:08 +01:00 committed by Christoph Oelckers
parent 7ede77c1d2
commit 166687d971
3 changed files with 12 additions and 7 deletions

View file

@ -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 <x> <y>\n");
Printf ("Usage: warp <x> <y> [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]));
}
}

View file

@ -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;

View file

@ -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.