From af7e63137faba33eed029e3b88ba809ea4893ab5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 21 Aug 2022 09:34:33 +0200 Subject: [PATCH] - got rid of most int_oz calls. --- source/games/sw/src/spike.cpp | 10 +++++----- source/games/sw/src/vator.cpp | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/source/games/sw/src/spike.cpp b/source/games/sw/src/spike.cpp index 47e1239e9..4137f587d 100644 --- a/source/games/sw/src/spike.cpp +++ b/source/games/sw/src/spike.cpp @@ -52,16 +52,16 @@ void ReverseSpike(DSWActor* actor) if (actor->user.z_tgt == actor->user.oz) { if (actor->spr.pos.Z == actor->user.oz) - actor->user.z_tgt = actor->user.int_upos().Z * zinttoworld; - else if (actor->user.int_upos().Z == actor->user.int_oz()) + actor->user.z_tgt = actor->user.pos.Z; + else if (actor->user.pos.Z == actor->user.oz) actor->user.z_tgt = actor->spr.pos.Z; } - else if (actor->user.int_z_tgt() == actor->user.int_upos().Z) + else if (actor->user.z_tgt == actor->user.pos.Z) { if (actor->spr.pos.Z == actor->user.oz) actor->user.z_tgt = actor->spr.pos.Z; - else if (actor->user.int_upos().Z == actor->user.int_oz()) - actor->user.z_tgt = actor->user.int_upos().Z * zinttoworld; + else if (actor->user.pos.Z == actor->user.oz) + actor->user.z_tgt = actor->user.pos.Z; } actor->user.vel_rate = -actor->user.vel_rate; diff --git a/source/games/sw/src/vator.cpp b/source/games/sw/src/vator.cpp index 04a9275bc..0f87c2c76 100644 --- a/source/games/sw/src/vator.cpp +++ b/source/games/sw/src/vator.cpp @@ -57,16 +57,16 @@ void ReverseVator(DSWActor* actor) if (actor->user.z_tgt == actor->user.oz) { if (actor->spr.pos.Z == actor->user.oz) - actor->user.z_tgt = actor->user.int_upos().Z * zinttoworld; - else if (actor->user.int_upos().Z == actor->user.int_oz()) + actor->user.z_tgt = actor->user.pos.Z; + else if (actor->user.pos.Z == actor->user.oz) actor->user.z_tgt = actor->spr.pos.Z; } - else if (actor->user.int_z_tgt() == actor->user.int_upos().Z) + else if (actor->user.z_tgt == actor->user.pos.Z) { if (actor->spr.pos.Z == actor->user.oz) actor->user.z_tgt = actor->spr.pos.Z; - else if (actor->user.int_upos().Z == actor->user.int_oz()) - actor->user.z_tgt = actor->user.int_upos().Z * zinttoworld; + else if (actor->user.pos.Z == actor->user.oz) + actor->user.z_tgt = actor->user.pos.Z; } actor->user.vel_rate = -actor->user.vel_rate; @@ -392,10 +392,10 @@ int DoVator(DSWActor* actor) if (zval == actor->user.int_z_tgt()) { // in the ON position - if (actor->user.int_z_tgt() == actor->int_pos().Z) + if (actor->user.z_tgt == actor->spr.pos.Z) { // change target - actor->user.z_tgt = actor->user.int_upos().Z * zinttoworld; + actor->user.z_tgt = actor->user.pos.Z; actor->user.vel_rate = -actor->user.vel_rate; SetVatorInactive(actor); @@ -406,7 +406,7 @@ int DoVator(DSWActor* actor) } else // in the OFF position - if (actor->user.int_z_tgt() == actor->user.int_upos().Z) + if (actor->user.z_tgt == actor->user.pos.Z) { short match = SP_TAG2(actor); @@ -503,7 +503,7 @@ int DoVator(DSWActor* actor) { if (itActor->spr.statnum == STAT_ENEMY) { - if (labs(sectp->int_ceilingz() - sectp->int_floorz()) < ActorSizeZ(itActor)) + if (abs(sectp->int_ceilingz() - sectp->int_floorz()) < ActorSizeZ(itActor)) { InitBloodSpray(itActor, true, -1); UpdateSinglePlayKills(itActor);