Attached Files | hexenactors.diff [^] (10,941 bytes) 2024-01-28 01:50 [Show Content] [Hide Content]# HG changeset patch
# User Ru5tK1ng
# Date 1706406349 21600
# Sat Jan 27 19:45:49 2024 -0600
# Branch hexenfixes
# Node ID 25f87c89377165d2b1e8ad8a7e8043d4b72cc4e4
# Parent f46ab13b972a3a2ffbd7baf2e88c43a1828ce7af
Fixed: Numerous Hexen actors and code pointers were sending invalid commands to clients that could not be executed (addresses 4187).
diff -r f46ab13b972a -r 25f87c893771 docs/zandronum-history.txt
--- a/docs/zandronum-history.txt Fri Sep 29 08:23:34 2023 -0400
+++ b/docs/zandronum-history.txt Sat Jan 27 19:45:49 2024 -0600
@@ -114,6 +114,7 @@
- - Fixed: the coop info wasn't getting drawn in clientside demos. [Kaminsky]
- - Fixed: Floatbob items having incorrect z-height after a map reset and glitchy GL floor clipping (addresses 2361). [Ru5tK1ng]
- - Fixed: Monsters spawned by BossBrain cubes would move before being spawned on the clients therefore triggering warning messages (addresses 2655). [Ru5tK1ng]
+- - Fixed: Numerous Hexen actors and code pointers were sending invalid commands to clients that could not be executed (addresses 4187). [Ru5tK1ng]
! - The result value of GAMEEVENT_MEDALS event scripts can now be used to determine whether or not the player receives the medal. [Kaminsky]
! - GAMEMODE flags are now validated after all GAMEMODE lumps have been parsed instead of after each one. The internal game mode name (e.g. "TeamLMS") is now printed with the error message instead of the actual name. [Kaminsky]
! - Added an extra check to ensure that game modes have a (short) name. [Kaminsky]
diff -r f46ab13b972a -r 25f87c893771 src/g_hexen/a_bats.cpp
--- a/src/g_hexen/a_bats.cpp Fri Sep 29 08:23:34 2023 -0400
+++ b/src/g_hexen/a_bats.cpp Sat Jan 27 19:45:49 2024 -0600
@@ -36,6 +36,11 @@
int delta;
angle_t angle;
+ // [RK] The server does this since it's spawned as a missile
+ // or client-side actors inheriting from BatSpawner.
+ if ( NETWORK_InClientModeAndActorNotClientHandled( self ))
+ return;
+
// Countdown until next spawn
if (self->special1-- > 0) return;
self->special1 = self->args[0]; // Reset frequency count
@@ -43,7 +48,7 @@
delta = self->args[1];
if (delta==0) delta=1;
angle = self->angle + (((pr_batspawn()%delta)-(delta>>1))<<24);
- mo = P_SpawnMissileAngle (self, PClass::FindClass ("Bat"), angle, 0);
+ mo = P_SpawnMissileAngle (self, PClass::FindClass ("Bat"), angle, 0, true); // [RK] Inform the clients.
if (mo)
{
mo->args[0] = pr_batspawn()&63; // floatbob index
@@ -58,6 +63,10 @@
{
angle_t newangle;
+ // [RK] The server does this along with client-side Bats.
+ if ( NETWORK_InClientModeAndActorNotClientHandled( self ))
+ return;
+
if (self->special2 < 0)
{
self->SetState (self->FindState(NAME_Death));
@@ -80,10 +89,14 @@
if (pr_batmove()<15)
{
- S_Sound (self, CHAN_VOICE, "BatScream", 1, ATTN_IDLE);
+ S_Sound (self, CHAN_VOICE, "BatScream", 1, ATTN_IDLE, true); // [RK] Inform the clients.
}
// Handle Z movement
self->z = self->target->z + 16*finesine[self->args[0] << BOBTOFINESHIFT];
self->args[0] = (self->args[0]+3)&63;
+
+ // [RK] Update the position on the clients.
+ if ( NETWORK_GetState() == NETSTATE_SERVER )
+ SERVERCOMMANDS_MoveThingExact( self, CM_VELX|CM_VELY|CM_Z );
}
diff -r f46ab13b972a -r 25f87c893771 src/g_hexen/a_fog.cpp
--- a/src/g_hexen/a_fog.cpp Fri Sep 29 08:23:34 2023 -0400
+++ b/src/g_hexen/a_fog.cpp Sat Jan 27 19:45:49 2024 -0600
@@ -54,6 +54,15 @@
mo->args[3] = self->args[3]; // Set lifetime
mo->args[4] = 1; // Set to moving
mo->special2 = pr_fogspawn()&63;
+
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
}
}
diff -r f46ab13b972a -r 25f87c893771 src/g_hexen/a_hexenspecialdecs.cpp
--- a/src/g_hexen/a_hexenspecialdecs.cpp Fri Sep 29 08:23:34 2023 -0400
+++ b/src/g_hexen/a_hexenspecialdecs.cpp Sat Jan 27 19:45:49 2024 -0600
@@ -67,6 +67,15 @@
mo->velz = ((pr_pottery()&7)+5)*(3*FRACUNIT/4);
mo->velx = (pr_pottery.Random2())<<(FRACBITS-6);
mo->vely = (pr_pottery.Random2())<<(FRACBITS-6);
+
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
}
}
S_Sound (mo, CHAN_BODY, "PotteryExplode", 1, ATTN_NORM);
@@ -156,9 +165,20 @@
DEFINE_ACTION_FUNCTION(AActor, A_CorpseBloodDrip)
{
+ AActor *mo; // [RK] Added mo
+
if (pr_drip() <= 128)
{
- Spawn ("CorpseBloodDrip", self->x, self->y, self->z + self->height/2, ALLOW_REPLACE);
+ mo = Spawn ("CorpseBloodDrip", self->x, self->y, self->z + self->height/2, ALLOW_REPLACE);
+
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER && mo )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
}
}
diff -r f46ab13b972a -r 25f87c893771 src/g_hexen/a_iceguy.cpp
--- a/src/g_hexen/a_iceguy.cpp Fri Sep 29 08:23:34 2023 -0400
+++ b/src/g_hexen/a_iceguy.cpp Sat Jan 27 19:45:49 2024 -0600
@@ -28,6 +28,7 @@
{
fixed_t dist;
fixed_t an;
+ AActor *mo; // [RK] Added mo
CALL_ACTION(A_Look, self);
if (pr_iceguylook() < 64)
@@ -35,10 +36,19 @@
dist = ((pr_iceguylook()-128)*self->radius)>>7;
an = (self->angle+ANG90)>>ANGLETOFINESHIFT;
- Spawn (WispTypes[pr_iceguylook()&1],
+ mo = Spawn (WispTypes[pr_iceguylook()&1],
self->x+FixedMul(dist, finecosine[an]),
self->y+FixedMul(dist, finesine[an]),
self->z+60*FRACUNIT, ALLOW_REPLACE);
+
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER && mo )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
}
}
@@ -70,6 +80,15 @@
mo->vely = self->vely;
mo->velz = self->velz;
mo->target = self;
+
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
}
}
}
@@ -133,10 +152,14 @@
AActor *mo;
unsigned int i;
+ // [RK] The server does this.
+ if ( NETWORK_InClientMode() )
+ return;
+
for (i = 0; i < 8; i++)
{
mo = P_SpawnMissileAngleZ (self, self->z+3*FRACUNIT,
- PClass::FindClass("IceGuyFX2"), i*ANG45, (fixed_t)(-0.3*FRACUNIT));
+ PClass::FindClass("IceGuyFX2"), i*ANG45, (fixed_t)(-0.3*FRACUNIT), true); // [RK] Inform the clients.
if (mo)
{
mo->target = self->target;
diff -r f46ab13b972a -r 25f87c893771 src/g_hexen/a_wraith.cpp
--- a/src/g_hexen/a_wraith.cpp Fri Sep 29 08:23:34 2023 -0400
+++ b/src/g_hexen/a_wraith.cpp Sat Jan 27 19:45:49 2024 -0600
@@ -120,6 +120,15 @@
mo = Spawn ("WraithFX2", self->x, self->y, self->z, ALLOW_REPLACE);
if(mo)
{
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
+
if (pr_wraithfx2 ()<128)
{
angle = self->angle+(pr_wraithfx2()<<22);
@@ -157,6 +166,15 @@
mo = Spawn ("WraithFX3", self->x, self->y, self->z, ALLOW_REPLACE);
if (mo)
{
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
+
mo->x += (pr_wraithfx3()-128)<<11;
mo->y += (pr_wraithfx3()-128)<<11;
mo->z += (pr_wraithfx3()<<10);
@@ -205,6 +223,15 @@
mo = Spawn ("WraithFX4", self->x, self->y, self->z, ALLOW_REPLACE);
if (mo)
{
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
+
mo->x += (pr_wraithfx4()-128)<<12;
mo->y += (pr_wraithfx4()-128)<<12;
mo->z += (pr_wraithfx4()<<10);
@@ -216,6 +243,15 @@
mo = Spawn ("WraithFX5", self->x, self->y, self->z, ALLOW_REPLACE);
if (mo)
{
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
+
mo->x += (pr_wraithfx4()-128)<<11;
mo->y += (pr_wraithfx4()-128)<<11;
mo->z += (pr_wraithfx4()<<10);
diff -r f46ab13b972a -r 25f87c893771 src/g_shared/a_action.cpp
--- a/src/g_shared/a_action.cpp Fri Sep 29 08:23:34 2023 -0400
+++ b/src/g_shared/a_action.cpp Sat Jan 27 19:45:49 2024 -0600
@@ -92,7 +92,7 @@
self->flags &= ~MF_SOLID;
// [EP] Inform the clients if needed.
- if (( NETWORK_GetState() == NETSTATE_SERVER ) && ( oldflags != self->flags ))
+ if (( NETWORK_GetState() == NETSTATE_SERVER ) && ( oldflags != self->flags ) && !( self->flags4 & MF4_NOICEDEATH )) // [RK] Body was removed long ago on the clients end.
{
SERVERCOMMANDS_SetThingFlags( self, FLAGSET_FLAGS );
}
diff -r f46ab13b972a -r 25f87c893771 src/g_shared/a_debris.cpp
--- a/src/g_shared/a_debris.cpp Fri Sep 29 08:23:34 2023 -0400
+++ b/src/g_shared/a_debris.cpp Sat Jan 27 19:45:49 2024 -0600
@@ -2,6 +2,7 @@
#include "info.h"
#include "m_random.h"
#include "m_fixed.h"
+#include "network.h" // [RK] Added include
static FRandom pr_dirt ("SpawnDirt");
@@ -49,6 +50,15 @@
mo = Spawn (dtype, x, y, z, ALLOW_REPLACE);
if (mo)
{
+ // [RK] Clients spawn these on their own. In order to prevent the
+ // server from printing warnings when the server calls P_ExplodeMissile,
+ // we also mark this as SERVERSIDEONLY.
+ if ( NETWORK_GetState() == NETSTATE_SERVER )
+ {
+ mo->NetworkFlags |= NETFL_SERVERSIDEONLY;
+ mo->FreeNetID();
+ }
+
mo->velz = pr_dirt()<<10;
}
}
|