From 00f88610aca418b3d7b68ab7fa2c83684f6c719b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 3 Aug 2009 20:40:45 +0000 Subject: [PATCH] - Added kgsws's SummonActor enhancement and bumped netgame and demo versions because this submission changes an existing command. SVN r1749 (trunk) --- docs/rh-log.txt | 6 +++++- src/d_net.cpp | 24 ++++++++++++++++++++++-- src/info.cpp | 13 +++++++++++-- src/version.h | 6 +++--- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 6dd36c71f..b2733cb1a 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,8 @@ -August 2, 2009 (Changes by Graf Zahl) +August 3, 2009 (Changes by Graf Zahl) +- Added kgsws's SummonActor enhancement and bumped netgame and demo versions + because this submission changes an existing command. + +August 2, 2009 (Changes by Graf Zahl) - Changed: DEHACKED parsing is disabled now when a user supplied DEHSUPP lump is found. This mimics the old behavior which also disabled DEHACKED when the DEHSUPP lump was incompatible with the current engine. This behavior is diff --git a/src/d_net.cpp b/src/d_net.cpp index 262d9c16f..8a1d10e4c 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2099,8 +2099,20 @@ void Net_DoCommand (int type, BYTE **stream, int player) case DEM_SUMMONFOE2: { const PClass *typeinfo; + int angle; + SWORD tid; + BYTE special; + int args[5]; s = ReadString (stream); + if (type >= DEM_SUMMON2 && type <= DEM_SUMMONFOE2) + { + angle = ReadWord(stream); + tid = ReadWord(stream); + special = ReadByte(stream); + for(i = 0; i < 5; i++) args[i] = ReadLong(stream); + } + typeinfo = PClass::FindClass (s); if (typeinfo != NULL && typeinfo->ActorInfo != NULL) { @@ -2140,8 +2152,13 @@ void Net_DoCommand (int type, BYTE **stream, int player) } if (type >= DEM_SUMMON2 && type <= DEM_SUMMONFOE2) { - int angle = ReadWord(stream); spawned->angle = source->angle - (ANGLE_1 * angle); + spawned->tid = tid; + spawned->special = special; + for(i = 0; i < 5; i++) { + spawned->args[i] = args[i]; + } + if(tid) spawned->AddToHash(); } } } @@ -2406,10 +2423,13 @@ void Net_SkipCommand (int type, BYTE **stream) case DEM_GIVECHEAT: case DEM_TAKECHEAT: + skip = strlen ((char *)(*stream)) + 3; + break; + case DEM_SUMMON2: case DEM_SUMMONFRIEND2: case DEM_SUMMONFOE2: - skip = strlen ((char *)(*stream)) + 3; + skip = strlen ((char *)(*stream)) + 26; break; case DEM_MUSICCHANGE: diff --git a/src/info.cpp b/src/info.cpp index 10fb568f2..a811054ff 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -421,8 +421,17 @@ static void SummonActor (int command, int command2, FCommandLine argv) Net_WriteByte (argv.argc() > 2 ? command2 : command); Net_WriteString (type->TypeName.GetChars()); - if (argv.argc () > 2) - Net_WriteWord (atoi (argv[2])); + if (argv.argc () > 2) { + Net_WriteWord (atoi (argv[2])); // angle + if (argv.argc () > 3) Net_WriteWord (atoi (argv[3])); // TID + else Net_WriteWord (0); + if (argv.argc () > 4) Net_WriteByte (atoi (argv[4])); // special + else Net_WriteByte (0); + for(int i = 5; i < 10; i++) { // args[5] + if(i < argv.argc()) Net_WriteLong (atoi (argv[i])); + else Net_WriteLong (0); + } + } } } diff --git a/src/version.h b/src/version.h index d1ab275ed..510bcd0de 100644 --- a/src/version.h +++ b/src/version.h @@ -54,7 +54,7 @@ // 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 222 +#define NETGAMEVERSION 223 // Version stored in the ini's [LastRun] section. // Bump it if you made some configuration change that you want to @@ -64,11 +64,11 @@ // 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 0x210 +#define DEMOGAMEVERSION 0x211 // Minimum demo version we can play. // Bump it whenever you change or remove existing DEM_ commands. -#define MINDEMOVERSION 0x210 +#define MINDEMOVERSION 0x211 // SAVEVER is the version of the information stored in level snapshots. // Note that SAVEVER is not directly comparable to VERSION.