Account for HIT flags in A_BFGSpray

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Account for HIT flags in A_BFGSpray

Postby Zhs2 » Tue Jul 24, 2018 12:54 pm

Simple three-liner, to account for the hit flags in A_BFGSpray. Useful for tracer rays that effect extra items on the monsters they hit, or so forth.

Code: Select allExpand view
...
            if (spray != null)
            {
               // Account for HIT flags.
               if(spray.bHitMaster) spray.master = t.linetarget;
               if(spray.bHitTarget) spray.target = t.linetarget;
               if(spray.bHitTracer) spray.tracer = t.linetarget;
               
               if ((spray.bMThruSpecies && target.GetSpecies() == t.linetarget.GetSpecies()) ||
                  (!(flags & BFGF_HURTSOURCE) && target == t.linetarget)) // [XA] Don't hit oneself unless we say so.
               {
                  spray.Destroy(); // [MC] Remove it because technically, the spray isn't trying to "hit" them.
                  continue;
               }
               // PUFFGETSOWNER should have the last say here for target, of course.
               if (spray.bPuffGetsOwner) spray.target = target;
               if (spray.bFoilInvul) dmgFlags |= DMG_FOILINVUL;
               if (spray.bFoilBuddha) dmgFlags |= DMG_FOILBUDDHA;
               dmgType = spray.DamageType;
            }
...
User avatar
Zhs2
Power of three.
 
Joined: 07 Nov 2008
Location: Maryland, USA, but probably also in someone's mod somewhere
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Return to Feature Suggestions

Who is online

Users browsing this forum: GAA1992 and 0 guests