Page 1 of 1

Account for HIT flags in A_BFGSpray

Posted: Tue Jul 24, 2018 11:54 am
by Zhs2
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 all

...
				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;
				}
...