From ef7be016c482b3de2efbb9dc34a0a8724ba77ac5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 18 Jan 2016 22:32:36 +0100 Subject: [PATCH] - all those 'actor->SetZ(actor->Z() +...) calls weren't pretty so now there's an AddZ method, too. --- src/g_heretic/a_dsparil.cpp | 2 +- src/g_heretic/a_hereticartifacts.cpp | 2 +- src/g_heretic/a_hereticmisc.cpp | 2 +- src/g_heretic/a_hereticweaps.cpp | 2 +- src/g_heretic/a_ironlich.cpp | 4 ++-- src/g_hexen/a_firedemon.cpp | 4 ++-- src/g_hexen/a_flechette.cpp | 4 ++-- src/p_enemy.cpp | 4 ++-- src/p_lnspec.cpp | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/g_heretic/a_dsparil.cpp b/src/g_heretic/a_dsparil.cpp index d2bed5b685..bb3cfb0c5d 100644 --- a/src/g_heretic/a_dsparil.cpp +++ b/src/g_heretic/a_dsparil.cpp @@ -257,7 +257,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard) mo = Spawn("Wizard", self->Pos(), ALLOW_REPLACE); if (mo != NULL) { - mo->SetZ(mo->Z() - mo->GetDefault()->height / 2, false); + mo->AddZ(-mo->GetDefault()->height / 2, false); if (!P_TestMobjLocation (mo)) { // Didn't fit mo->ClearCounters(); diff --git a/src/g_heretic/a_hereticartifacts.cpp b/src/g_heretic/a_hereticartifacts.cpp index 86416038f3..322869f19e 100644 --- a/src/g_heretic/a_hereticartifacts.cpp +++ b/src/g_heretic/a_hereticartifacts.cpp @@ -47,7 +47,7 @@ bool AArtiTomeOfPower::Use (bool pickup) DEFINE_ACTION_FUNCTION(AActor, A_TimeBomb) { - self->SetZ(self->Z() + 32*FRACUNIT, false); + self->AddZ(32*FRACUNIT, false); self->PrevZ = self->Z(); // no interpolation! self->RenderStyle = STYLE_Add; self->alpha = FRACUNIT; diff --git a/src/g_heretic/a_hereticmisc.cpp b/src/g_heretic/a_hereticmisc.cpp index 5d324ff779..09c3d42538 100644 --- a/src/g_heretic/a_hereticmisc.cpp +++ b/src/g_heretic/a_hereticmisc.cpp @@ -192,7 +192,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact) { self->flags |= MF_NOGRAVITY; self->gravity = FRACUNIT; - self->SetZ(self->Z() + 28*FRACUNIT); + self->AddZ(28*FRACUNIT); //self->velz = 3*FRACUNIT; } P_RadiusAttack (self, self->target, 25, 25, NAME_Fire, RADF_HURTSOURCE); diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index 2121bf5a2c..8ec05b75e5 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -388,7 +388,7 @@ void FireMacePL1B (AActor *actor) angle = actor->angle; ball->target = actor; ball->angle = angle; - ball->SetZ(ball->Z() + 2*finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)]); + ball->AddZ(2*finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)]); angle >>= ANGLETOFINESHIFT; ball->velx = (actor->velx>>1) + FixedMul(ball->Speed, finecosine[angle]); ball->vely = (actor->vely>>1) + FixedMul(ball->Speed, finesine[angle]); diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index b09864bd02..206ba5e8b5 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -127,7 +127,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack) mo = P_SpawnMissile (self, target, RUNTIME_CLASS(AWhirlwind)); if (mo != NULL) { - mo->SetZ(mo->Z() - 32*FRACUNIT, false); + mo->AddZ(-32*FRACUNIT, false); mo->tracer = target; mo->special1 = 60; mo->special2 = 50; // Timer for active sound @@ -200,7 +200,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact) DEFINE_ACTION_FUNCTION(AActor, A_LichFireGrow) { self->health--; - self->SetZ(self->Z() + 9*FRACUNIT); + self->AddZ(9*FRACUNIT); if (self->health == 0) { self->Damage = self->GetDefault()->Damage; diff --git a/src/g_hexen/a_firedemon.cpp b/src/g_hexen/a_firedemon.cpp index 72981df977..e33c838964 100644 --- a/src/g_hexen/a_firedemon.cpp +++ b/src/g_hexen/a_firedemon.cpp @@ -134,13 +134,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase) if (self->threshold) self->threshold--; // Float up and down - self->SetZ(self->Z() + finesine[weaveindex << BOBTOFINESHIFT] * 8); + self->AddZ(finesine[weaveindex << BOBTOFINESHIFT] * 8); self->special1 = (weaveindex + 2) & 63; // Ensure it stays above certain height if (self->Z() < self->floorz + (64*FRACUNIT)) { - self->SetZ(self->Z() + 2*FRACUNIT); + self->AddZ(2*FRACUNIT); } if(!self->target || !(self->target->flags&MF_SHOOTABLE)) diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index 47869c48ab..ef8e27ca19 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -132,7 +132,7 @@ bool AArtiPoisonBag3::Use (bool pickup) mo->velz = FixedMul(speed, finesine[modpitch]); mo->velx = FixedMul(xyscale, finecosine[angle]) + (Owner->velx >> 1); mo->vely = FixedMul(xyscale, finesine[angle]) + (Owner->vely >> 1); - mo->SetZ(mo->Z() + FixedMul(mo->Speed, finesine[orgpitch])); + mo->AddZ(FixedMul(mo->Speed, finesine[orgpitch])); mo->target = Owner; mo->tics -= pr_poisonbag()&3; @@ -421,7 +421,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagDamage) P_RadiusAttack (self, self->target, 4, 40, self->DamageType, RADF_HURTSOURCE); bobIndex = self->special2; - self->SetZ(self->Z() + finesine[bobIndex << BOBTOFINESHIFT] >> 1); + self->AddZ(finesine[bobIndex << BOBTOFINESHIFT] >> 1); self->special2 = (bobIndex + 1) & 63; } diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index ef2e15955f..90a7a5f5ca 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -568,9 +568,9 @@ bool P_Move (AActor *actor) fixed_t savedz = actor->Z(); if (actor->Z() < tm.floorz) - actor->SetZ(actor->Z() + actor->FloatSpeed); + actor->AddZ(actor->FloatSpeed); else - actor->SetZ(actor->Z() - actor->FloatSpeed); + actor->AddZ(-actor->FloatSpeed); // [RH] Check to make sure there's nothing in the way of the float diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 06e2f5f215..05259ba3e6 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -3107,7 +3107,7 @@ FUNC(LS_GlassBreak) { glass = Spawn("GlassJunk", x, y, ONFLOORZ, ALLOW_REPLACE); - glass->SetZ(glass->Z() + 24 * FRACUNIT); + glass->AddZ(24 * FRACUNIT); glass->SetState (glass->SpawnState + (pr_glass() % glass->health)); an = pr_glass() << (32-8); glass->angle = an;