From 9717082759845865c8fdc71bf8bf324641f95734 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 31 Aug 2022 00:49:16 +0200 Subject: [PATCH] - int_change is gone --- source/games/sw/src/game.h | 1 - source/games/sw/src/weapon.cpp | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index b353d78b7..6bf314345 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -943,7 +943,6 @@ struct USER memset(&WallP, 0, sizeof(USER) - myoffsetof(USER, WallP)); } - vec3_t int_change() const { return { int(change.X * worldtoint), int(change.Y * worldtoint), int(change.Z * zworldtoint) }; } void set_int_change_x(int x) { change.X = x * inttoworld; } void set_int_change_y(int x) { change.Y = x * inttoworld; } void set_int_change_z(int x) { change.Z = x * zinttoworld; } diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index d73990fed..11ada5fb3 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -8400,9 +8400,9 @@ int DoVulcanBoulder(DSWActor* actor) actor->user.coll = move_missile(actor, actor->user.change, actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS); - int32_t const vel = ksqrt(SQ(actor->user.int_change().X) + SQ(actor->user.int_change().Y)); + auto velsq = actor->user.change.XY().LengthSquared(); - if (vel < 30) + if (velsq < 1.875 * 1.875) { SpawnLittleExp(actor); KillActor(actor); @@ -12548,10 +12548,8 @@ int InitStar(PLAYER* pp) } // move the same as middle star - zvel = actorNew->user.int_change().Z; - + actorNew2->user.change.Z = actorNew->user.change.Z; UpdateChangeXY(actorNew2); - actorNew2->user.set_int_change_z(zvel); actorNew2->backuppos(); }