Revision | c73c3e63f6762675db06426996931f97843565f8 (tree) |
---|---|
Time | 2022-09-16 23:16:18 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Fixed: rail attacks didn't always account for sv_shootthroughallies.
@@ -76,6 +76,7 @@ | ||
76 | 76 | - - Fixed: puffs didn't enter their XDeath states in online games. [Kaminsky] |
77 | 77 | - - Fixed: spawning game mode artifacts like the possession stone and terminator ball didn't correctly account for useplayerstartz. [Kaminsky] |
78 | 78 | - - 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] | |
79 | 80 | ! - The result value of GAMEEVENT_MEDALS event scripts can now be used to determine whether or not the player receives the medal. [Kaminsky] |
80 | 81 | ! - 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] |
81 | 82 | ! - Added an extra check to ensure that game modes have a (short) name. [Kaminsky] |
@@ -4778,6 +4778,10 @@ | ||
4778 | 4778 | TArray<SRailHit> RailHits; |
4779 | 4779 | bool StopAtOne; |
4780 | 4780 | bool StopAtInvul; |
4781 | + | |
4782 | + // [AK] Added caller and hitscan puff actor pointers. | |
4783 | + AActor *pCaller; | |
4784 | + AActor *pPuff; | |
4781 | 4785 | }; |
4782 | 4786 | |
4783 | 4787 | static ETraceStatus ProcessRailHit(FTraceResults &res, void *userdata) |
@@ -4788,6 +4792,12 @@ | ||
4788 | 4792 | return TRACE_Stop; |
4789 | 4793 | } |
4790 | 4794 | |
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 | + | |
4791 | 4801 | // Invulnerable things completely block the shot |
4792 | 4802 | if (data->StopAtInvul && res.Actor->flags2 & MF2_INVULNERABLE) |
4793 | 4803 | { |
@@ -4865,6 +4875,10 @@ | ||
4865 | 4875 | flags = (puffDefaults->flags6 & MF6_NOTRIGGER) ? 0 : TRACE_PCross | TRACE_Impact; |
4866 | 4876 | rail_data.StopAtInvul = (puffDefaults->flags3 & MF3_FOILINVUL) ? false : true; |
4867 | 4877 | |
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 | + | |
4868 | 4882 | Trace(x1, y1, shootz, source->Sector, vx, vy, vz, |
4869 | 4883 | distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace, |
4870 | 4884 | flags, ProcessRailHit, &rail_data); |