diff --git a/src/p_map.cpp b/src/p_map.cpp index 4777d7e9c..7d3474cf1 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4478,7 +4478,7 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b AActor *thing; if (flags & RADF_SOURCEISSPOT) - { // The source is actually the same as the spot, even if that wasn't what we receized. + { // The source is actually the same as the spot, even if that wasn't what we received. bombsource = bombspot; } @@ -4567,11 +4567,12 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b } points *= thing->GetClass()->Meta.GetMetaFixed(AMETA_RDFactor, FRACUNIT)/(double)FRACUNIT; - if (points > 0.f && P_CheckSight (thing, bombspot, SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY)) + // points and bombdamage should be the same sign + if ((points * bombdamage) > 0 && P_CheckSight (thing, bombspot, SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY)) { // OK to damage; target is in direct path double velz; double thrust; - int damage = (int)points; + int damage = abs((int)points); int newdam = damage; if (!(flags & RADF_NODAMAGE)) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index c1ff7853d..542ab1698 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -838,8 +838,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusThrust) bool sourcenothrust = false; - if (force <= 0) force = 128; - if (distance <= 0) distance = force; + if (force == 0) force = 128; + if (distance <= 0) distance = abs(force); // Temporarily negate MF2_NODMGTHRUST on the shooter, since it renders this function useless. if (!(flags & RTF_NOTMISSILE) && self->target != NULL && self->target->flags2 & MF2_NODMGTHRUST) @@ -847,7 +847,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusThrust) sourcenothrust = true; self->target->flags2 &= ~MF2_NODMGTHRUST; } - int sourceflags2 = self->target != NULL ? self->target->flags2 : 0; P_RadiusAttack (self, self->target, force, distance, self->DamageType, flags | RADF_NODAMAGE, fullthrustdistance); P_CheckSplash(self, distance << FRACBITS);