• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revisionc73c3e63f6762675db06426996931f97843565f8 (tree)
Time2022-09-16 23:16:18
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Fixed: rail attacks didn't always account for sv_shootthroughallies.

Change Summary

Incremental Difference

diff -r f69316e9f35c -r c73c3e63f676 docs/zandronum-history.txt
--- a/docs/zandronum-history.txt Thu Sep 15 02:25:55 2022 -0400
+++ b/docs/zandronum-history.txt Fri Sep 16 10:16:18 2022 -0400
@@ -76,6 +76,7 @@
7676 - - Fixed: puffs didn't enter their XDeath states in online games. [Kaminsky]
7777 - - Fixed: spawning game mode artifacts like the possession stone and terminator ball didn't correctly account for useplayerstartz. [Kaminsky]
7878 - - Fixed: cl_telespy still teleported a spectator when they were already looking through their own eyes. [Kaminsky]
79+- - Fixed: rail attacks didn't always account for sv_shootthroughallies. [Kaminsky]
7980 ! - The result value of GAMEEVENT_MEDALS event scripts can now be used to determine whether or not the player receives the medal. [Kaminsky]
8081 ! - 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]
8182 ! - Added an extra check to ensure that game modes have a (short) name. [Kaminsky]
diff -r f69316e9f35c -r c73c3e63f676 src/p_map.cpp
--- a/src/p_map.cpp Thu Sep 15 02:25:55 2022 -0400
+++ b/src/p_map.cpp Fri Sep 16 10:16:18 2022 -0400
@@ -4778,6 +4778,10 @@
47784778 TArray<SRailHit> RailHits;
47794779 bool StopAtOne;
47804780 bool StopAtInvul;
4781+
4782+ // [AK] Added caller and hitscan puff actor pointers.
4783+ AActor *pCaller;
4784+ AActor *pPuff;
47814785 };
47824786
47834787 static ETraceStatus ProcessRailHit(FTraceResults &res, void *userdata)
@@ -4788,6 +4792,12 @@
47884792 return TRACE_Stop;
47894793 }
47904794
4795+ // [AK] Check if this player can shoot through their teammates if ZADF_SHOOT_THROUGH_ALLIES is enabled.
4796+ if ( PLAYER_CannotAffectAllyWith( data->pCaller, res.Actor, data->pPuff, ZADF_SHOOT_THROUGH_ALLIES ))
4797+ {
4798+ return TRACE_Skip;
4799+ }
4800+
47914801 // Invulnerable things completely block the shot
47924802 if (data->StopAtInvul && res.Actor->flags2 & MF2_INVULNERABLE)
47934803 {
@@ -4865,6 +4875,10 @@
48654875 flags = (puffDefaults->flags6 & MF6_NOTRIGGER) ? 0 : TRACE_PCross | TRACE_Impact;
48664876 rail_data.StopAtInvul = (puffDefaults->flags3 & MF3_FOILINVUL) ? false : true;
48674877
4878+ // [AK] Remember the actor who fired the rail and the puff actor that is supposed to spawn.
4879+ rail_data.pCaller = source;
4880+ rail_data.pPuff = puffDefaults;
4881+
48684882 Trace(x1, y1, shootz, source->Sector, vx, vy, vz,
48694883 distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace,
48704884 flags, ProcessRailHit, &rail_data);
Show on old repository browser