From 92fbe47ade6129585768d75ceb7b32c94b603e52 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Jan 2015 14:04:06 +0100 Subject: [PATCH] - fixed and cleaned up ALoreShot::DoSpecialDamage. --- src/g_strife/a_loremaster.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/g_strife/a_loremaster.cpp b/src/g_strife/a_loremaster.cpp index d720b7b9b..38cadab34 100644 --- a/src/g_strife/a_loremaster.cpp +++ b/src/g_strife/a_loremaster.cpp @@ -14,27 +14,27 @@ class ALoreShot : public AActor { DECLARE_CLASS (ALoreShot, AActor) public: - int DoSpecialDamage (AActor *target, int damage, FName damagetype); + int DoSpecialDamage (AActor *victim, int damage, FName damagetype); }; IMPLEMENT_CLASS (ALoreShot) -int ALoreShot::DoSpecialDamage (AActor *target, int damage, FName damagetype) +int ALoreShot::DoSpecialDamage (AActor *victim, int damage, FName damagetype) { FVector3 thrust; - if (this->target != NULL && !(this->target->flags7 & MF7_DONTTHRUST)) + if (victim != NULL && target != NULL && !(victim->flags7 & MF7_DONTTHRUST)) { - thrust.X = float(this->target->x - target->x); - thrust.Y = float(this->target->y - target->y); - thrust.Z = float(this->target->z - target->z); + thrust.X = float(target->x - victim->x); + thrust.Y = float(target->y - victim->y); + thrust.Z = float(target->z - victim->z); thrust.MakeUnit(); - thrust *= float((255*50*FRACUNIT) / (target->Mass ? target->Mass : 1)); + thrust *= float((255*50*FRACUNIT) / (victim->Mass ? target->Mass : 1)); - target->velx += fixed_t(thrust.X); - target->vely += fixed_t(thrust.Y); - target->velz += fixed_t(thrust.Z); + victim->velx += fixed_t(thrust.X); + victim->vely += fixed_t(thrust.Y); + victim->velz += fixed_t(thrust.Z); } return damage; }