- added a damage type parameter to MDK CCMD.

This commit is contained in:
Christoph Oelckers 2017-02-27 20:07:21 +01:00
parent ac4074a69a
commit e511f7f84b
5 changed files with 32 additions and 8 deletions

View file

@ -2380,6 +2380,11 @@ void Net_DoCommand (int type, BYTE **stream, int player)
SprayDecal(players[player].mo, s);
break;
case DEM_MDK:
s = ReadString(stream);
cht_DoMDK(&players[player], s);
break;
case DEM_PAUSE:
if (gamestate == GS_LEVEL)
{
@ -2666,13 +2671,12 @@ void Net_DoCommand (int type, BYTE **stream, int player)
case DEM_NETEVENT:
{
const char *ename = ReadString(stream);
s = ReadString(stream);
int argn = ReadByte(stream);
int arg[3] = { 0, 0, 0 };
for (int i = 0; i < 3; i++)
arg[i] = ReadLong(stream);
E_Console(player, ename, arg[0], arg[1], arg[2]);
delete[] ename;
E_Console(player, s, arg[0], arg[1], arg[2]);
}
break;
@ -2723,7 +2727,7 @@ void Net_SkipCommand (int type, BYTE **stream)
break;
case DEM_NETEVENT:
skip = strlen((char *)(*stream)) + 13;
skip = strlen((char *)(*stream)) + 14;
break;
case DEM_SUMMON2:
@ -2747,6 +2751,7 @@ void Net_SkipCommand (int type, BYTE **stream)
case DEM_SPRAY:
case DEM_MORPHEX:
case DEM_KILLCLASSCHEAT:
case DEM_MDK:
skip = strlen ((char *)(*stream)) + 1;
break;

View file

@ -159,7 +159,8 @@ enum EDemoCommand
DEM_SETSLOTPNUM, // 67 Byte: player number, the rest is the same as DEM_SETSLOT
DEM_REMOVE, // 68
DEM_FINISHGAME, // 69
DEM_NETEVENT // 70 String: Event name, Byte: Arg count; each arg is a 4-byte int
DEM_NETEVENT, // 70 String: Event name, Byte: Arg count; each arg is a 4-byte int
DEM_MDK // 71 String: Damage type
};
// The following are implemented by cht_DoCheat in m_cheat.cpp

View file

@ -55,6 +55,22 @@
// writes some bytes to the network data stream, and the network code
// later calls us.
void cht_DoMDK(player_t *player, const char *mod)
{
if (player->mo == NULL)
{
Printf("What do you want to kill outside of a game?\n");
}
else if (!deathmatch)
{
// Don't allow this in deathmatch even with cheats enabled, because it's
// a very very cheap kill.
P_LineAttack(player->mo, player->mo->Angles.Yaw, PLAYERMISSILERANGE,
P_AimLineAttack(player->mo, player->mo->Angles.Yaw, PLAYERMISSILERANGE), TELEFRAG_DAMAGE,
mod, NAME_BulletPuff);
}
}
void cht_DoCheat (player_t *player, int cheat)
{
static const char * const BeholdPowers[9] =
@ -671,6 +687,7 @@ CCMD (mdk)
if (CheckCheatmode ())
return;
Net_WriteByte (DEM_GENERICCHEAT);
Net_WriteByte (CHT_MDK);
const char *name = argv.argc() > 1 ? argv[1] : "";
Net_WriteByte (DEM_MDK);
Net_WriteString(name);
}

View file

@ -31,6 +31,7 @@
class player_t;
class PClassActor;
void cht_DoMDK(player_t *player, const char *mod);
void cht_DoCheat (player_t *player, int cheat);
void cht_Give (player_t *player, const char *item, int amount=1);
void cht_Take (player_t *player, const char *item, int amount=1);

View file

@ -57,7 +57,7 @@ const char *GetVersionString();
// Version identifier for network games.
// Bump it every time you do a release unless you're certain you
// didn't change anything that will affect sync.
#define NETGAMEVERSION 232
#define NETGAMEVERSION 233
// Version stored in the ini's [LastRun] section.
// Bump it if you made some configuration change that you want to