From 62ba7535854d2282f2e1bc7802eefc64bcba103e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 3 Sep 2022 10:02:25 +0200 Subject: [PATCH] - remove vel clear wrappers --- source/common/filesystem/filesystem.cpp | 4 +- source/common/utility/vectors.h | 2 +- source/core/coreactor.h | 20 -------- source/games/blood/src/actor.cpp | 2 +- source/games/duke/src/actors.cpp | 30 +++++------ source/games/duke/src/actors_d.cpp | 40 +++++++-------- source/games/duke/src/actors_r.cpp | 26 +++++----- source/games/duke/src/player_d.cpp | 6 +-- source/games/duke/src/player_r.cpp | 4 +- source/games/duke/src/spawn_d.cpp | 2 +- source/games/duke/src/spawn_r.cpp | 4 +- source/games/exhumed/src/anims.cpp | 6 +-- source/games/exhumed/src/anubis.cpp | 28 +++++----- source/games/exhumed/src/bubbles.cpp | 4 +- source/games/exhumed/src/bullet.cpp | 6 +-- source/games/exhumed/src/fish.cpp | 16 +++--- source/games/exhumed/src/grenade.cpp | 8 +-- source/games/exhumed/src/items.cpp | 6 +-- source/games/exhumed/src/lavadude.cpp | 12 ++--- source/games/exhumed/src/lion.cpp | 32 ++++++------ source/games/exhumed/src/move.cpp | 16 +++--- source/games/exhumed/src/mummy.cpp | 40 +++++++-------- source/games/exhumed/src/object.cpp | 34 ++++++------- source/games/exhumed/src/player.cpp | 20 ++++---- source/games/exhumed/src/queen.cpp | 32 ++++++------ source/games/exhumed/src/ra.cpp | 6 +-- source/games/exhumed/src/rat.cpp | 26 +++++----- source/games/exhumed/src/rex.cpp | 20 ++++---- source/games/exhumed/src/roach.cpp | 24 ++++----- source/games/exhumed/src/scorp.cpp | 20 ++++---- source/games/exhumed/src/set.cpp | 48 ++++++++--------- source/games/exhumed/src/snake.cpp | 6 +-- source/games/exhumed/src/spider.cpp | 22 ++++---- source/games/exhumed/src/wasp.cpp | 22 ++++---- source/games/sw/src/actor.cpp | 4 +- source/games/sw/src/jweapon.cpp | 6 +-- source/games/sw/src/miscactr.cpp | 68 ++++++++++++------------- source/games/sw/src/ninja.cpp | 2 +- source/games/sw/src/skull.cpp | 4 +- source/games/sw/src/sprite.cpp | 8 +-- source/games/sw/src/track.cpp | 4 +- source/games/sw/src/weapon.cpp | 48 ++++++++--------- 42 files changed, 359 insertions(+), 379 deletions(-) diff --git a/source/common/filesystem/filesystem.cpp b/source/common/filesystem/filesystem.cpp index 5af6215fb..d4ef4e904 100644 --- a/source/common/filesystem/filesystem.cpp +++ b/source/common/filesystem/filesystem.cpp @@ -841,7 +841,7 @@ int FileSystem::GetFileFlags (int lump) uint32_t FileSystem::LumpNameHash (const char *s) { - const uint32_t *table = GetCRCTable ();; + const uint32_t *table = GetCRCTable (); uint32_t hash = 0xffffffff; int i; @@ -1698,4 +1698,4 @@ CCMD(fs_dir) bool hidden = fileSystem.FindFile(fn1) != i; Printf(PRINT_NONOTIFY, "%s%-64s %-15s (%5d) %10d %s %s\n", hidden ? TEXTCOLOR_RED : TEXTCOLOR_UNTRANSLATED, fn1, fns, fnid, length, container, hidden ? "(h)" : ""); } -} \ No newline at end of file +} diff --git a/source/common/utility/vectors.h b/source/common/utility/vectors.h index 65448c2c2..017d1a520 100644 --- a/source/common/utility/vectors.h +++ b/source/common/utility/vectors.h @@ -577,7 +577,7 @@ struct TVector3 } up = n ^right; - right.MakeUnit();; + right.MakeUnit(); up.MakeUnit(); } diff --git a/source/core/coreactor.h b/source/core/coreactor.h index e00cf16a0..4f50fa918 100644 --- a/source/core/coreactor.h +++ b/source/core/coreactor.h @@ -123,11 +123,6 @@ public: return vel.Z; } - void clear_zvel() - { - vel.Z = 0; - } - void set_int_zvel(int v) { vel.Z = v * zinttoworld; @@ -143,11 +138,6 @@ public: vel.Z *= v; } - void clear_xyvel() - { - vel.X = vel.Y = 0; - } - // Note: Both Duke and SW use Q12.4 for this, Exhumed doesn't seem to treat horizontal velocity with a fixed factor. int int_xvel() const { @@ -159,11 +149,6 @@ public: return vel.X; } - void clear_xvel() - { - vel.X = 0; - } - void set_int_xvel(int v) { vel.X = v * inttoworld; @@ -190,11 +175,6 @@ public: return vel.Y; } - void clear_yvel() - { - vel.Y = 0; - } - void set_int_yvel(int v) { vel.Y = v * inttoworld; diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index 167a813d0..8b611cfa5 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -4615,7 +4615,7 @@ static Collision MoveThing(DBloodActor* actor) actor->spr.flags |= 4; auto vec4 = actFloorBounceVector(actor, FixedToFloat(v20), actor->sector(), FixedToFloat(pThingInfo->elastic)); - actor->vel,XY() = vec4.XY(); + actor->vel.XY() = vec4.XY(); int vax = FloatToFixed(vec4.W); int nDamage = MulScale(vax, vax, 30) - pThingInfo->dmgResist; diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 5eb4f5ed4..38a843572 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -741,7 +741,7 @@ void movecrane(DDukeActor *actor, int crane) if (actor->spr.pos.Z < cpt.pos.Z) { actor->temp_data[0]++; - actor->clear_xvel(); + actor->vel.X = 0; } else actor->spr.pos.Z -= 6; @@ -784,7 +784,7 @@ void movecrane(DDukeActor *actor, int crane) Owner->opos = actor->spr.pos; - actor->clear_zvel(); + actor->vel.Z = 0; } else if (actor->IsActiveCrane()) { @@ -1481,7 +1481,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball) } actor->add_int_xvel(-1); - if(actor->float_xvel() < 0) actor->clear_xvel(); + if(actor->float_xvel() < 0) actor->vel.X = 0; if (actor->spr.picnum == stripeball) { actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; @@ -1687,7 +1687,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p { actor->temp_data[3] = 0; if(actor->float_xvel() > 0) actor->add_int_xvel(-16); - else actor->clear_xvel(); + else actor->vel.X = 0; if (actor->temp_data[0] == 2) { @@ -1734,7 +1734,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p else { if(actor->float_xvel() > 0) actor->add_int_xvel(-16); - else actor->clear_xvel(); + else actor->vel.X = 0; } } @@ -2153,7 +2153,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f auto sectp = actor->sector(); if(actor->float_xvel() > 0) actor->add_int_xvel(-1); - else actor->clear_xvel(); + else actor->vel.X = 0; if (timeout) { @@ -2252,7 +2252,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f double ll = getflorzofslopeptrf(actor->sector(), actor->spr.pos); actor->spr.pos.Z = ll - 2; - actor->clear_xvel(); + actor->vel.X = 0; if (actor->spr.picnum == JIBS6) { @@ -2385,7 +2385,7 @@ void shell(DDukeActor* actor, bool morecheck) else actor->add_int_zvel(- 64); if(actor->float_xvel() > 0) actor->add_int_xvel(-4); - else actor->clear_xvel(); + else actor->vel.X = 0; } else { @@ -2448,7 +2448,7 @@ void glasspieces(DDukeActor* actor) static const ESpriteFlags flips[] = { 0, CSTAT_SPRITE_XFLIP, CSTAT_SPRITE_YFLIP, CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP }; actor->spr.cstat = flips[int(actor->float_xvel() * 16) & 3]; } - else actor->clear_xvel(); + else actor->vel.X = 0; ssp(actor, CLIPMASK0); } @@ -2465,7 +2465,7 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6) if(actor->float_xvel() > 0) actor->add_int_xvel(-1); - else actor->clear_xvel(); + else actor->vel.X = 0; if (actor->float_zvel() > 4 && actor->float_zvel() < 5) { @@ -2965,13 +2965,13 @@ void handle_se30(DDukeActor *actor, int JIBS6) int l = FindDistance2D(Owner->int_pos().vec2 - actor->int_pos().vec2); if (l <= 128) - actor->clear_xvel(); + actor->vel.X = 0; if(actor->float_xvel() > 0) actor->add_int_xvel(-16); else { - actor->clear_xvel(); + actor->vel.X = 0; operateactivators(actor->spr.hitag + (short)actor->temp_data[3], -1); actor->SetOwner(nullptr); actor->add_int_ang(1024); @@ -4857,7 +4857,7 @@ void makeitfall(DDukeActor* actor) if (actor->spr.pos.Z >= actor->floorz - FOURSLEIGHT_F) { actor->spr.pos.Z = actor->floorz - FOURSLEIGHT_F; - actor->clear_zvel(); + actor->vel.Z = 0; } } @@ -5114,7 +5114,7 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO actor->attackertype = SHOTSPARK1; actor->hitextra = 1; - actor->clear_zvel(); + actor->vel.Z = 0; } else if (actor->float_zvel() > 8 && actor->sector()->lotag != 1) { @@ -5129,7 +5129,7 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO } if (actor->sector()->lotag == 1) actor->add_int_z(gs.actorinfo[actor->spr.picnum].falladjustz); - else actor->clear_zvel(); + else actor->vel.Z = 0; } } } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index df69fca13..37b43d376 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -237,7 +237,7 @@ bool ifsquished(DDukeActor* actor, int p) FTA(QUOTE_SQUISHED, &ps[p]); if (badguy(actor)) - actor->clear_xvel(); + actor->vel.X = 0; if (actor->spr.pal == 1) { @@ -394,7 +394,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h if (act2->spr.picnum != TANK && act2->spr.picnum != ROTATEGUN && act2->spr.picnum != RECON && !bossguy(act2)) { - if (act2->int_xvel() < 0) act2->clear_xvel(); + if (act2->int_xvel() < 0) act2->vel.X = 0; act2->add_int_xvel( (actor->spr.extra << 2)); } @@ -1602,8 +1602,8 @@ static void weaponcommon_d(DDukeActor* proj) { return; } - proj->clear_xvel(); - proj->clear_zvel(); + proj->vel.X = 0; + proj->vel.Z = 0; } bool fireball = (isWorldTour() && proj->spr.picnum == FIREBALL && (!proj->GetOwner() || proj->GetOwner()->spr.picnum != FIREBALL)); @@ -2295,7 +2295,7 @@ static void greenslime(DDukeActor *actor) makeitfall(actor); if (s5) { - s5->clear_xvel(); + s5->vel.X = 0; actor->spr.pos = s5->spr.pos + s5->spr.angle.ToVector() * 0.5; actor->spr.picnum = GREENSLIME + 2 + (global_random & 1); @@ -2347,7 +2347,7 @@ static void greenslime(DDukeActor *actor) if (actor->temp_data[0] == 2) { - actor->clear_zvel(); + actor->vel.Z = 0; actor->spr.cstat &= ~CSTAT_SPRITE_YFLIP; if ((sectp->ceilingstat & CSTAT_SECTOR_SKY) || (actor->ceilingz + 24) < actor->spr.pos.Z) @@ -2386,7 +2386,7 @@ static void greenslime(DDukeActor *actor) if (rnd(4) && (sectp->ceilingstat & CSTAT_SECTOR_SKY) == 0 && fabs(actor->floorz - actor->ceilingz) < 192) { - actor->clear_zvel(); + actor->vel.Z = 0; actor->temp_data[0]++; } @@ -2403,7 +2403,7 @@ static void greenslime(DDukeActor *actor) if (actor->spr.pos.Z < actor->ceilingz + 16) { actor->spr.pos.Z = actor->ceilingz + 16; - actor->clear_xvel(); + actor->vel.X = 0; actor->temp_data[0] = 2; } } @@ -2429,7 +2429,7 @@ static void greenslime(DDukeActor *actor) { actor->spr.pos.Z = actor->floorz - 8; actor->temp_data[0] = 0; - actor->clear_xvel(); + actor->vel.X = 0; } } } @@ -2499,8 +2499,8 @@ static void flamethrowerflame(DDukeActor *actor) } if (coll.type != 0) { - actor->clear_xyvel(); - actor->clear_zvel(); + actor->ZeroVelocityXY(); + actor->vel.Z = 0; if (coll.type == kHitSprite) { fi.checkhitsprite(coll.actor(), actor); @@ -2569,7 +2569,7 @@ static void heavyhbomb(DDukeActor *actor) actor->temp_data[3] = 1; actor->temp_data[4] = 0; l = 0; - actor->clear_xvel(); + actor->vel.X = 0; goto DETONATEB; } } @@ -2590,7 +2590,7 @@ static void heavyhbomb(DDukeActor *actor) if (actor->spr.pos.Z < actor->ceilingz) // && sectp->lotag != 2 ) { actor->spr.pos.Z = actor->ceilingz + 3; - actor->clear_zvel(); + actor->vel.Z = 0; } } @@ -2616,7 +2616,7 @@ static void heavyhbomb(DDukeActor *actor) actor->temp_data[3] = 1; actor->temp_data[4] = 0; l = 0; - actor->clear_xvel(); + actor->vel.X = 0; goto DETONATEB; } @@ -2631,7 +2631,7 @@ static void heavyhbomb(DDukeActor *actor) actor->add_int_xvel(-10); if(actor->float_xvel() < 0) - actor->clear_xvel(); + actor->vel.X = 0; if (int(actor->float_xvel() * 16) & 8) actor->spr.cstat ^= CSTAT_SPRITE_XFLIP; } @@ -3164,7 +3164,7 @@ void handle_se06_d(DDukeActor* actor) if (actor->temp_data[4] >= (k - (k >> 3))) actor->add_int_xvel(-(k >> 5)); if (actor->temp_data[4] > ((k >> 1) - 1) && actor->temp_data[4] < (k - (k >> 3))) - actor->clear_xvel(); + actor->vel.X = 0; if (actor->temp_data[4] < (k >> 1)) actor->add_int_xvel( (k >> 5)); if (actor->temp_data[4] < ((k >> 1) - (k >> 3))) @@ -3558,7 +3558,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel) if (actor->spr.picnum != APLAYER) alterang(a, actor, playernum); - if (actor->int_xvel() > -6 && actor->int_xvel() < 6) actor->clear_xvel(); + if (actor->int_xvel() > -6 && actor->int_xvel() < 6) actor->vel.X = 0; a = badguy(actor); @@ -3578,13 +3578,13 @@ void move_d(DDukeActor *actor, int playernum, int xvel) if (actor->spr.pos.Z > f - 8) { actor->spr.pos.Z = f - 8; - actor->clear_zvel(); + actor->vel.Z = 0; } if (actor->spr.pos.Z < c + 80) { actor->spr.pos.Z = c + 80; - actor->clear_zvel(); + actor->vel.Z = 0; } } else @@ -3603,7 +3603,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel) if (actor->spr.pos.Z < c + 50) { actor->spr.pos.Z = c + 50; - actor->clear_zvel(); + actor->vel.Z = 0; } } } diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 6e46f7351..f2e8c6a68 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -330,7 +330,7 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h (pic != HULK && pic != MAMA && pic != BILLYPLAY && pic != COOTPLAY && pic != MAMACLOUD) : (pic != HULK && pic != SBMOVE)) { - if (act2->int_xvel() < 0) act2->clear_xvel(); + if (act2->int_xvel() < 0) act2->vel.X = 0; act2->add_int_xvel( (act2->spr.extra << 2)); } @@ -2341,7 +2341,7 @@ static void heavyhbomb(DDukeActor *actor) actor->temp_data[3] = 1; actor->temp_data[4] = 0; l = 0; - actor->clear_xvel(); + actor->vel.X = 0; goto DETONATEB; } } @@ -2370,7 +2370,7 @@ static void heavyhbomb(DDukeActor *actor) if (actor->spr.picnum != CHEERBOMB && actor->spr.pos.Z < actor->ceilingz + 16 && sectp->lotag != 2) { actor->spr.pos.Z = actor->ceilingz + 16; - actor->clear_zvel(); + actor->vel.Z = 0; } Collision coll; @@ -2387,7 +2387,7 @@ static void heavyhbomb(DDukeActor *actor) actor->temp_data[5] = 1; spawn(actor, WATERSPLASH2); if (isRRRA() && actor->spr.picnum == MORTER) - actor->clear_xvel(); + actor->vel.X = 0; } } else actor->temp_data[5] = 0; @@ -2397,7 +2397,7 @@ static void heavyhbomb(DDukeActor *actor) actor->temp_data[3] = 1; actor->temp_data[4] = 0; l = 0; - actor->clear_xvel(); + actor->vel.X = 0; goto DETONATEB; } @@ -2406,7 +2406,7 @@ static void heavyhbomb(DDukeActor *actor) actor->temp_data[3] = 1; actor->temp_data[4] = 0; l = 0; - actor->clear_xvel(); + actor->vel.X = 0; goto DETONATEB; } @@ -2421,7 +2421,7 @@ static void heavyhbomb(DDukeActor *actor) actor->add_int_xvel(-10); if(actor->float_xvel() < 0) - actor->clear_xvel(); + actor->vel.X = 0; if (int(actor->float_xvel() * 16) & 8) actor->spr.cstat ^= CSTAT_SPRITE_XFLIP; } @@ -2437,7 +2437,7 @@ static void heavyhbomb(DDukeActor *actor) actor->temp_data[3] = 1; actor->temp_data[4] = 0; l = 0; - actor->clear_xvel(); + actor->vel.X = 0; goto DETONATEB; } actor->set_int_ang(((k << 1) - actor->int_ang()) & 2047); @@ -2557,7 +2557,7 @@ static int henstand(DDukeActor *actor) } } if (actor->sector()->lotag == 900) - actor->clear_xvel(); + actor->vel.X = 0; if(actor->float_xvel() != 0) { makeitfall(actor); @@ -2591,7 +2591,7 @@ static int henstand(DDukeActor *actor) } } actor->add_int_xvel(-1); - if(actor->float_xvel() < 0) actor->clear_xvel(); + if(actor->float_xvel() < 0) actor->vel.X = 0; actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; if (actor->spr.picnum == BOWLINGPIN) { @@ -3153,7 +3153,7 @@ void handle_se06_r(DDukeActor *actor) if (actor->temp_data[4] >= (k - (k >> 3))) actor->add_int_xvel(-(k >> 5)); if (actor->temp_data[4] > ((k >> 1) - 1) && actor->temp_data[4] < (k - (k >> 3))) - actor->clear_xvel(); + actor->vel.X = 0; if (actor->temp_data[4] < (k >> 1)) actor->add_int_xvel( (k >> 5)); if (actor->temp_data[4] < ((k >> 1) - (k >> 3))) @@ -3629,7 +3629,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel) if (actor->spr.picnum != APLAYER) alterang(a, actor, pnum); - if (actor->int_xvel() > -6 && actor->int_xvel() < 6) actor->clear_xvel(); + if (actor->int_xvel() > -6 && actor->int_xvel() < 6) actor->vel.X = 0; a = badguy(actor); @@ -3654,7 +3654,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel) if (actor->spr.pos.Z < c + 50) { actor->spr.pos.Z = c + 50; - actor->clear_zvel(); + actor->vel.Z = 0; } } } diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 713d77c64..e9ea87fe3 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -299,7 +299,7 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa) splash->spr.angle = ps[p].angle.ang; // Total tweek splash->set_int_xvel(32); ssp(actor, CLIPMASK0); - splash->clear_xvel(); + splash->vel.X = 0; } } @@ -1065,7 +1065,7 @@ void shoot_d(DDukeActor* actor, int atwith) k->spr.pos = spos; k->spr.angle = sang; k->set_int_xvel(500); - k->clear_zvel(); + k->vel.Z = 0; } return; } @@ -2848,7 +2848,7 @@ void processinput_d(int snum) if (p->newOwner != nullptr) { p->vel.X = p->vel.Y = 0; - pact->clear_xvel(); + pact->vel.X = 0; fi.doincrements(p); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index e919fb00b..f37d3bb03 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -189,7 +189,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa, splash->spr.angle = ps[p].angle.ang; // Total tweek splash->set_int_xvel(32); ssp(actor, 0); - splash->clear_xvel(); + splash->vel.X = 0; } } } @@ -3561,7 +3561,7 @@ void processinput_r(int snum) if (p->newOwner != nullptr) { p->vel.X = p->vel.Y = 0; - pact->clear_xvel(); + pact->vel.X = 0; fi.doincrements(p); diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 13414d6b9..162794c7c 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -899,7 +899,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* } if (act->spr.picnum == ROTATEGUN) - act->clear_zvel(); + act->vel.Z = 0; break; diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 988dc4c5d..9d53200d5 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -527,7 +527,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* act->spr.clipdist = 8; act->spr.xrepeat = 13; act->spr.yrepeat = 10; - act->clear_xvel(); + act->vel.X = 0; ChangeActorStat(act, 1); break; case BOWLINGPIN: @@ -1160,7 +1160,7 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* } else { - act->clear_zvel(); + act->vel.Z = 0; } ssp(act, CLIPMASK0); act->spr.cstat = randomXFlip(); diff --git a/source/games/exhumed/src/anims.cpp b/source/games/exhumed/src/anims.cpp index 3211f9028..7695e259f 100644 --- a/source/games/exhumed/src/anims.cpp +++ b/source/games/exhumed/src/anims.cpp @@ -86,9 +86,9 @@ DExhumedActor* BuildAnim(DExhumedActor* pActor, int val, int val2, const DVector pActor->set_int_ang(0); pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->backuppos(); // CHECKME - where is hitag set otherwise? diff --git a/source/games/exhumed/src/anubis.cpp b/source/games/exhumed/src/anubis.cpp index 35ce67ede..f39abec92 100644 --- a/source/games/exhumed/src/anubis.cpp +++ b/source/games/exhumed/src/anubis.cpp @@ -68,9 +68,9 @@ void BuildAnubis(DExhumedActor* ap, const DVector3& pos, sectortype* pSector, in ap->set_int_ang(nAngle); ap->spr.xrepeat = 40; ap->spr.yrepeat = 40; - ap->clear_xvel(); - ap->clear_yvel(); - ap->clear_zvel(); + ap->vel.X = 0; + ap->vel.Y = 0; + ap->vel.Z = 0; ap->spr.hitag = 0; ap->spr.lotag = runlist_HeadRun() + 1; ap->spr.extra = -1; @@ -214,8 +214,8 @@ void AIAnubis::Tick(RunListEvent* ev) if (cansee(ap->spr.pos.plusZ(-GetActorHeightF(ap)), ap->sector(), pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector())) { - ap->clear_xvel(); - ap->clear_yvel(); + ap->vel.X = 0; + ap->vel.Y = 0; ap->spr.angle = VecToAngle(pTarget->spr.pos - ap->spr.pos); ap->nAction = 3; @@ -276,8 +276,8 @@ void AIAnubis::Tick(RunListEvent* ev) case 4: case 5: { - ap->clear_xvel(); - ap->clear_yvel(); + ap->vel.X = 0; + ap->vel.Y = 0; if (bVal) { @@ -307,8 +307,8 @@ void AIAnubis::Tick(RunListEvent* ev) ap->nAction = nAction + 2; ap->nFrame = 0; - ap->clear_xvel(); - ap->clear_yvel(); + ap->vel.X = 0; + ap->vel.Y = 0; } return; } @@ -333,8 +333,8 @@ void AIAnubis::Tick(RunListEvent* ev) ap->nCount = 100; ap->pTarget = nullptr; - ap->clear_xvel(); - ap->clear_yvel(); + ap->vel.X = 0; + ap->vel.Y = 0; } } } @@ -413,9 +413,9 @@ void AIAnubis::Damage(RunListEvent* ev) else { // he ded. - ap->clear_xvel(); - ap->clear_yvel(); - ap->clear_zvel(); + ap->vel.X = 0; + ap->vel.Y = 0; + ap->vel.Z = 0; ap->spr.pos.Z = ap->sector()->floorz; ap->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; diff --git a/source/games/exhumed/src/bubbles.cpp b/source/games/exhumed/src/bubbles.cpp index f96ea3d4b..4c1c5a0f4 100644 --- a/source/games/exhumed/src/bubbles.cpp +++ b/source/games/exhumed/src/bubbles.cpp @@ -53,8 +53,8 @@ DExhumedActor* BuildBubble(const DVector3& pos, sectortype* pSector) pActor->spr.yoffset = 0; pActor->spr.picnum = 1; pActor->set_int_ang(inita); - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->set_int_zvel(-1200); pActor->spr.hitag = -1; pActor->spr.extra = -1; diff --git a/source/games/exhumed/src/bullet.cpp b/source/games/exhumed/src/bullet.cpp index 3287f8342..4e2046533 100644 --- a/source/games/exhumed/src/bullet.cpp +++ b/source/games/exhumed/src/bullet.cpp @@ -618,9 +618,9 @@ DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int nZOffset, int n pBulletActor->spr.xoffset = 0; pBulletActor->spr.yoffset = 0; pBulletActor->set_int_ang(nAngle); - pBulletActor->clear_xvel(); - pBulletActor->clear_yvel(); - pBulletActor->clear_zvel(); + pBulletActor->vel.X = 0; + pBulletActor->vel.Y = 0; + pBulletActor->vel.Z = 0; pBulletActor->spr.lotag = runlist_HeadRun() + 1; pBulletActor->spr.extra = -1; pBulletActor->spr.hitag = 0; diff --git a/source/games/exhumed/src/fish.cpp b/source/games/exhumed/src/fish.cpp index b15ebde9d..c0656c0e3 100644 --- a/source/games/exhumed/src/fish.cpp +++ b/source/games/exhumed/src/fish.cpp @@ -106,7 +106,7 @@ void AIFishLimb::Tick(RunListEvent* ev) if ((pActor->spr.pos.Z - FloorZ) > 100) { - pActor->clear_zvel(); + pActor->vel.Z = 0; runlist_DoSubRunRec(pActor->spr.intowner); runlist_FreeRun(pActor->spr.lotag - 1); runlist_SubRunRec(pActor->spr.hitag); @@ -122,8 +122,8 @@ void AIFishLimb::Tick(RunListEvent* ev) auto coll = movesprite(pActor, pActor->int_xvel() << 8, pActor->int_yvel() << 8, pActor->int_zvel(), 2560, -2560, CLIPMASK1); if (coll.type != kHitNone) { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } } @@ -160,9 +160,9 @@ void BuildFish(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->spr.picnum = seq_GetSeqPicnum(kSeqFish, FishSeq[0].a, 0); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->set_int_ang(nAngle); pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.hitag = 0; @@ -378,8 +378,8 @@ void AIFish::Tick(RunListEvent* ev) } else { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } pActor->set_int_zvel(int((pTargetActor->spr.pos.Z - pActor->spr.pos.Z) * zworldtoint / 8)); diff --git a/source/games/exhumed/src/grenade.cpp b/source/games/exhumed/src/grenade.cpp index 4d11161d0..6817e3cb4 100644 --- a/source/games/exhumed/src/grenade.cpp +++ b/source/games/exhumed/src/grenade.cpp @@ -114,9 +114,9 @@ void BuildGrenade(int nPlayer) pActor->spr.yoffset = 0; pActor->spr.angle = pPlayerActor->spr.angle; pActor->spr.intowner = nPlayer; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.extra = -1; @@ -306,7 +306,7 @@ void AIGrenade::Tick(RunListEvent* ev) D3PlayFX(StaticSound[kSound5], pActor); pActor->nCount = 0; pActor->nHealth = 0; - pActor->clear_zvel(); + pActor->vel.Z = 0; pActor->nIndex = 1; } } diff --git a/source/games/exhumed/src/items.cpp b/source/games/exhumed/src/items.cpp index dee19e803..13ff85f05 100644 --- a/source/games/exhumed/src/items.cpp +++ b/source/games/exhumed/src/items.cpp @@ -422,9 +422,9 @@ void DoRegenerates() pActor->spr.yint = 0; pActor->spr.xint = 0; - pActor->clear_yvel(); - pActor->clear_xvel(); - pActor->clear_zvel(); + pActor->vel.Y = 0; + pActor->vel.X = 0; + pActor->vel.Z = 0; if (pActor->spr.statnum == kStatExplodeTrigger) { diff --git a/source/games/exhumed/src/lavadude.cpp b/source/games/exhumed/src/lavadude.cpp index 576bccd15..33675378b 100644 --- a/source/games/exhumed/src/lavadude.cpp +++ b/source/games/exhumed/src/lavadude.cpp @@ -77,9 +77,9 @@ void AILavaDudeLimb::Tick(RunListEvent* ev) if (coll.type || pActor->spr.shade > 100) { - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; runlist_DoSubRunRec(pActor->spr.intowner); runlist_FreeRun(pActor->spr.lotag - 1); @@ -122,9 +122,9 @@ void BuildLava(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->spr.picnum = seq_GetSeqPicnum(kSeqLavag, LavadudeSeq[3].a, 0); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->set_int_ang(nAngle); pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; diff --git a/source/games/exhumed/src/lion.cpp b/source/games/exhumed/src/lion.cpp index f5472298a..a5f7947a1 100644 --- a/source/games/exhumed/src/lion.cpp +++ b/source/games/exhumed/src/lion.cpp @@ -65,9 +65,9 @@ void BuildLion(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->set_int_ang(nAngle); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.hitag = 0; pActor->spr.extra = -1; @@ -119,9 +119,9 @@ void AILion::Damage(RunListEvent* ev) if (pActor->nHealth <= 0) { // R.I.P. - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; pActor->nHealth = 0; @@ -160,8 +160,8 @@ void AILion::Damage(RunListEvent* ev) if (RandomSize(8) <= (pActor->nHealth >> 2)) { pActor->nAction = 4; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } else if (RandomSize(1)) { @@ -173,8 +173,8 @@ void AILion::Damage(RunListEvent* ev) else { pActor->nAction = 8; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; } @@ -257,8 +257,8 @@ void AILion::Tick(RunListEvent* ev) } else { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } pActor->nCount = 100; @@ -304,8 +304,8 @@ void AILion::Tick(RunListEvent* ev) { pActor->nAction = 9; pActor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } else { @@ -528,8 +528,8 @@ void AILion::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->nCount = 100; pActor->pTarget = nullptr; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } } } diff --git a/source/games/exhumed/src/move.cpp b/source/games/exhumed/src/move.cpp index 5aa0e9f98..83a8a18cf 100644 --- a/source/games/exhumed/src/move.cpp +++ b/source/games/exhumed/src/move.cpp @@ -295,7 +295,7 @@ int BelowNear(DExhumedActor* pActor, double walldist) { pActor->set_int_z(z2); overridesect = pSector; - pActor->clear_zvel(); + pActor->vel.Z = 0; bTouchFloor = true; @@ -412,7 +412,7 @@ Collision movespritez(DExhumedActor* pActor, int z, int height, int, int clipdis nRet = loHit; } - pActor->clear_zvel(); + pActor->vel.Z = 0; } } else @@ -438,7 +438,7 @@ Collision movespritez(DExhumedActor* pActor, int z, int height, int, int clipdis } } - pActor->clear_zvel(); + pActor->vel.Z = 0; } } } @@ -589,14 +589,14 @@ void Gravity(DExhumedActor* pActor) { pActor->add_int_zvel(- 64); if (pActor->float_zvel() < 0) { - pActor->clear_zvel(); + pActor->vel.Z = 0; } } else if (pActor->float_zvel() < 0) { pActor->add_int_zvel( 64); if (pActor->float_zvel() > 0) { - pActor->clear_zvel(); + pActor->vel.Z = 0; } } } @@ -1359,9 +1359,9 @@ void AICreatureChunk::Tick(RunListEvent* ev) // re-grab this variable as it may have changed in movesprite(). Note the check above is against the value *before* movesprite so don't change it. pSector = pActor->sector(); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.pos.Z = pSector->floorz; } else diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index 731c79452..7b2cd3635 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -53,9 +53,9 @@ void BuildMummy(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; pActor->spr.shade = -12; pActor->spr.clipdist = 32; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.xrepeat = 42; pActor->spr.yrepeat = 42; pActor->spr.pal = pActor->sector()->ceilingpal; @@ -147,8 +147,8 @@ void AIMummy::Tick(RunListEvent* ev) { pActor->nAction = 0; pActor->nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } } @@ -207,8 +207,8 @@ void AIMummy::Tick(RunListEvent* ev) pActor->nAction = 3; pActor->nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; return; } } @@ -228,14 +228,14 @@ void AIMummy::Tick(RunListEvent* ev) { pActor->add_int_xvel(-1024); if (pActor->float_xvel() < 0) { - pActor->clear_xvel(); + pActor->vel.X = 0; } } else if (pActor->float_xvel() < 0) { pActor->add_int_xvel( 1024); if (pActor->float_xvel() > 0) { - pActor->clear_xvel(); + pActor->vel.X = 0; } } @@ -243,14 +243,14 @@ void AIMummy::Tick(RunListEvent* ev) { pActor->add_int_yvel(-1024); if (pActor->float_yvel() < 0) { - pActor->clear_yvel(); + pActor->vel.Y = 0; } } else if (pActor->float_yvel() < 0) { pActor->add_int_yvel(1024); if (pActor->float_yvel() > 0) { - pActor->clear_yvel(); + pActor->vel.Y = 0; } } } @@ -275,8 +275,8 @@ void AIMummy::Tick(RunListEvent* ev) pActor->nAction = 2; pActor->nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } } return; @@ -379,8 +379,8 @@ void AIMummy::Tick(RunListEvent* ev) if (bVal) { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; pActor->nAction = 0; @@ -440,9 +440,9 @@ void AIMummy::Damage(RunListEvent* ev) pActor->nFrame = 0; pActor->nAction = 4; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.pos.Z = pActor->sector()->floorz; } else @@ -452,8 +452,8 @@ void AIMummy::Damage(RunListEvent* ev) pActor->nAction = 7; pActor->nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } } diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 4b0a12c4f..205f98792 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -1202,9 +1202,9 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx) ChangeActorStat(pActor, 0); pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.extra = -1; pActor->spr.lotag = runlist_HeadRun() + 1; @@ -1446,9 +1446,9 @@ void AISpark::Tick(RunListEvent* ev) } } - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; if (pActor->spr.picnum > kTile3000) { nSmokeSparks--; @@ -1583,9 +1583,9 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector) pActor->spr.xrepeat = nRepeat; pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.extra = -1; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.hitag = 0; @@ -1784,9 +1784,9 @@ DExhumedActor* BuildObject(DExhumedActor* pActor, int nOjectType, int nHitag) // 0x7FFD to ensure set as blocking ('B' and 'H') sprite and also disable translucency and set not invisible pActor->spr.cstat = (pActor->spr.cstat | CSTAT_SPRITE_BLOCK_ALL) & ~(CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_INVISIBLE); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.extra = -1; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.hitag = 0; @@ -1902,8 +1902,8 @@ void AIObject::Tick(RunListEvent* ev) if (nMov.type == kHitSprite) { - pActor->clear_yvel(); - pActor->clear_xvel(); + pActor->vel.Y = 0; + pActor->vel.X = 0; } } @@ -2031,9 +2031,9 @@ void AIObject::RadialDamage(RunListEvent* ev) if (pActor->spr.statnum == kStatExplodeTarget) { - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; } else if (pActor->spr.statnum != kStatAnubisDrum) { diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 34d691f55..fd0fde2ec 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -300,9 +300,9 @@ void RestartPlayer(int nPlayer) pActor->spr.picnum = seq_GetSeqPicnum(kSeqJoe, 18, 0); int nHeight = GetActorHeight(pActor); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; nStandHeight = nHeight; @@ -545,8 +545,8 @@ void SetPlayerMummified(int nPlayer, int bIsMummified) { DExhumedActor* pActor = PlayerList[nPlayer].pActor; - pActor->clear_yvel(); - pActor->clear_xvel(); + pActor->vel.Y = 0; + pActor->vel.X = 0; PlayerList[nPlayer].bIsMummified = bIsMummified; @@ -923,9 +923,9 @@ void AIPlayer::Tick(RunListEvent* ev) lPlayerXVel = 0; lPlayerYVel = 0; - pPlayerActor->clear_xvel(); - pPlayerActor->clear_yvel(); - pPlayerActor->clear_zvel(); + pPlayerActor->vel.X = 0; + pPlayerActor->vel.Y = 0; + pPlayerActor->vel.Z = 0; if (nFreeze < 1) { @@ -976,8 +976,8 @@ void AIPlayer::Tick(RunListEvent* ev) if (PlayerList[nPlayer].nHealth <= 0) { - pPlayerActor->clear_xvel(); - pPlayerActor->clear_yvel(); + pPlayerActor->vel.X = 0; + pPlayerActor->vel.Y = 0; StopActorSound(pPlayerActor); PlayFXAtXYZ(StaticSound[kSoundJonFDie], pPlayerActor->spr.pos, CHANF_NONE, 1); // CHECKME diff --git a/source/games/exhumed/src/queen.cpp b/source/games/exhumed/src/queen.cpp index bf94cf49c..b9e3a1e1d 100644 --- a/source/games/exhumed/src/queen.cpp +++ b/source/games/exhumed/src/queen.cpp @@ -453,8 +453,8 @@ void BuildQueenEgg(int nQueen, int nVal) { pActor2->spr.xrepeat = 60; pActor2->spr.yrepeat = 60; - pActor2->clear_xvel(); - pActor2->clear_yvel(); + pActor2->vel.X = 0; + pActor2->vel.Y = 0; pActor2->set_int_zvel(-2000); pActor2->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; } @@ -622,7 +622,7 @@ void AIQueenEgg::Tick(RunListEvent* ev) pActor->set_int_zvel(-(pActor->int_zvel() - 256)); if (pActor->float_zvel() < -2) { - pActor->clear_zvel(); + pActor->vel.Z = 0; } } @@ -802,7 +802,7 @@ void AIQueenHead::Tick(RunListEvent* ev) if (pActor->float_zvel() > -1) { nVelShift = 100; - pActor->clear_zvel(); + pActor->vel.Z = 0; } } @@ -816,8 +816,8 @@ void AIQueenHead::Tick(RunListEvent* ev) } else { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; if (pActor->float_zvel() == 0) { @@ -1098,9 +1098,9 @@ void BuildQueen(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.yoffset = 0; pActor->spr.picnum = 1; pActor->set_int_ang(nAngle); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.extra = -1; pActor->spr.hitag = 0; @@ -1222,8 +1222,8 @@ void AIQueen::Tick(RunListEvent* ev) if (QueenList[nQueen].nIndex <= 0) { QueenList[nQueen].nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; QueenList[nQueen].nAction = si + 4; QueenList[nQueen].nIndex = RandomSize(6) + 30; break; @@ -1290,8 +1290,8 @@ void AIQueen::Tick(RunListEvent* ev) QueenList[nQueen].nIndex = 100; QueenList[nQueen].pTarget = nullptr; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } } @@ -1419,9 +1419,9 @@ void AIQueen::Damage(RunListEvent* ev) if (QueenList[nQueen].nHealth <= 0) { - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; QueenList[nQueen].nAction2++; diff --git a/source/games/exhumed/src/ra.cpp b/source/games/exhumed/src/ra.cpp index e57d322a6..71f206486 100644 --- a/source/games/exhumed/src/ra.cpp +++ b/source/games/exhumed/src/ra.cpp @@ -90,9 +90,9 @@ void BuildRa(int nPlayer) auto pActor = insertActor(pPlayerActor->sector(), 203); pActor->spr.cstat = CSTAT_SPRITE_INVISIBLE; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.extra = -1; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.hitag = 0; diff --git a/source/games/exhumed/src/rat.cpp b/source/games/exhumed/src/rat.cpp index 26c94d5dd..cade8d7bd 100644 --- a/source/games/exhumed/src/rat.cpp +++ b/source/games/exhumed/src/rat.cpp @@ -97,9 +97,9 @@ void BuildRat(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, i pActor->set_int_ang(nAngle); pActor->spr.xrepeat = 50; pActor->spr.yrepeat = 50; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.hitag = 0; pActor->spr.extra = -1; @@ -171,8 +171,8 @@ void AIRat::Damage(RunListEvent* ev) if (ev->nDamage) { pActor->spr.cstat = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->nAction = 3; pActor->nFrame = 0; } @@ -234,8 +234,8 @@ void AIRat::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->pTarget = nullptr; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; return; } @@ -272,8 +272,8 @@ void AIRat::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->pTarget = nullptr; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } MoveCreature(pActor); @@ -299,8 +299,8 @@ void AIRat::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->nPhase = RandomSize(3); - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; return; } case 2: @@ -319,8 +319,8 @@ void AIRat::Tick(RunListEvent* ev) pActor->nCount = RandomSize(6); if (pActor->float_xvel() != 0 || pActor->float_yvel() != 0) { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; return; } diff --git a/source/games/exhumed/src/rex.cpp b/source/games/exhumed/src/rex.cpp index c89a8df2e..1c791ea65 100644 --- a/source/games/exhumed/src/rex.cpp +++ b/source/games/exhumed/src/rex.cpp @@ -61,9 +61,9 @@ void BuildRex(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, i pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->set_int_ang(nAngle); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.extra = -1; pActor->spr.hitag = 0; @@ -122,9 +122,9 @@ void AIRex::Damage(RunListEvent* ev) if (pActor->nHealth <= 0) { - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; pActor->nHealth = 0; @@ -246,8 +246,8 @@ void AIRex::Tick(RunListEvent* ev) { pActor->nAction = 5; pActor->nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; return; } else @@ -437,8 +437,8 @@ void AIRex::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->nCount = 0; pActor->pTarget = nullptr; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } } return; diff --git a/source/games/exhumed/src/roach.cpp b/source/games/exhumed/src/roach.cpp index fb994c4f5..d19bbc853 100644 --- a/source/games/exhumed/src/roach.cpp +++ b/source/games/exhumed/src/roach.cpp @@ -59,9 +59,9 @@ void BuildRoach(int nType, DExhumedActor* pActor, const DVector3& pos, sectortyp pActor->set_int_ang(angle); pActor->spr.xrepeat = 40; pActor->spr.yrepeat = 40; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.extra = -1; @@ -130,9 +130,9 @@ void AIRoach::Damage(RunListEvent* ev) pActor->nHealth -= dmgAdjust(ev->nDamage); if (pActor->nHealth <= 0) { - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; pActor->nHealth = 0; @@ -271,8 +271,8 @@ void AIRoach::Tick(RunListEvent* ev) pActor->nIndex = RandomSize(2) + 1; pActor->nAction = 3; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->spr.angle = VecToAngle(pTarget->spr.pos - pActor->spr.pos); pActor->nFrame = 0; @@ -300,8 +300,8 @@ void AIRoach::Tick(RunListEvent* ev) pActor->nIndex = RandomSize(2) + 1; pActor->nAction = 3; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->spr.angle = VecToAngle(pTarget->spr.pos - pActor->spr.pos); pActor->nFrame = 0; @@ -314,8 +314,8 @@ void AIRoach::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->nCount = 100; pActor->pTarget = nullptr; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } return; diff --git a/source/games/exhumed/src/scorp.cpp b/source/games/exhumed/src/scorp.cpp index 0781d6a67..69cb48c28 100644 --- a/source/games/exhumed/src/scorp.cpp +++ b/source/games/exhumed/src/scorp.cpp @@ -62,9 +62,9 @@ void BuildScorp(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->set_int_ang(nAngle); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.extra = -1; pActor->spr.hitag = 0; @@ -127,9 +127,9 @@ void AIScorp::Damage(RunListEvent* ev) pActor->nFrame = 0; pActor->nCount = 10; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; nCreaturesKilled++; @@ -426,8 +426,8 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) if (cansee(pActor->spr.pos.plusZ(-GetActorHeightF(pActor)), pActor->sector(), pTarget->spr.pos.plusZ(-GetActorHeightF(pTarget)), pTarget->sector())) { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->spr.angle = VecToAngle(pTarget->spr.pos - pActor->spr.pos); pActor->nIndex = RandomSize(2) + RandomSize(3); @@ -455,8 +455,8 @@ void AIScorp::Effect(RunListEvent* ev, DExhumedActor* pTarget, int mode) pActor->nCount = 30; pActor->pTarget = nullptr; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } } diff --git a/source/games/exhumed/src/set.cpp b/source/games/exhumed/src/set.cpp index dff0f5be4..4c47bad7a 100644 --- a/source/games/exhumed/src/set.cpp +++ b/source/games/exhumed/src/set.cpp @@ -56,9 +56,9 @@ void BuildSet(DExhumedActor* pActor, const DVector3& pos, sectortype* pSector, i pActor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; pActor->spr.shade = -12; pActor->spr.clipdist = 110; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.xrepeat = 87; pActor->spr.yrepeat = 96; pActor->spr.pal = pActor->sector()->ceilingpal; @@ -105,8 +105,8 @@ void BuildSoul(DExhumedActor* pSet) pActor->spr.yoffset = 0; pActor->spr.picnum = seq_GetSeqPicnum(kSeqSet, 75, 0); pActor->set_int_ang(RandomSize(11)); - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->set_int_zvel((-256) - RandomSize(10)); pActor->spr.pos = DVector3(pSet->spr.pos.XY(), RandomSize(8) + 32 + pActor->sector()->ceilingz - GetActorHeightF(pActor)); @@ -185,9 +185,9 @@ void AISet::Damage(RunListEvent* ev) if (pActor->nHealth <= 0) { - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL; pActor->nHealth = 0; @@ -326,8 +326,8 @@ void AISet::Tick(RunListEvent* ev) pActor->nIndex = 0; pActor->nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->pTarget = FindPlayer(pActor, 1000); } @@ -357,8 +357,8 @@ void AISet::Tick(RunListEvent* ev) pActor->nIndex = 0; pActor->nAction = 7; pActor->nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; return; } case 1: @@ -368,8 +368,8 @@ void AISet::Tick(RunListEvent* ev) pActor->nAction = 6; pActor->nFrame = 0; pActor->nRun = 5; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; return; } default: @@ -411,8 +411,8 @@ void AISet::Tick(RunListEvent* ev) pActor->nIndex = 1; pActor->nAction = 7; pActor->nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; return; } } @@ -440,8 +440,8 @@ void AISet::Tick(RunListEvent* ev) pActor->nIndex = 1; pActor->nAction = 7; pActor->nFrame = 0; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; return; } } @@ -551,8 +551,8 @@ void AISet::Tick(RunListEvent* ev) if (bVal) { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; PlotCourseToSprite(pActor, pTarget); @@ -560,8 +560,8 @@ void AISet::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->nRun = 5; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } return; } @@ -608,8 +608,8 @@ void AISet::Tick(RunListEvent* ev) pActor->nFrame = 0; pActor->nCount = 100; pActor->pTarget = nullptr; - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; } } } diff --git a/source/games/exhumed/src/snake.cpp b/source/games/exhumed/src/snake.cpp index 748c3719e..94ea35c3b 100644 --- a/source/games/exhumed/src/snake.cpp +++ b/source/games/exhumed/src/snake.cpp @@ -215,9 +215,9 @@ void BuildSnake(int nPlayer, int zVal) pActor->spr.xoffset = 0; pActor->spr.yoffset = 0; pActor->spr.angle = pPlayerActor->spr.angle; - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.hitag = 0; pActor->spr.extra = -1; pActor->spr.lotag = runlist_HeadRun() + 1; diff --git a/source/games/exhumed/src/spider.cpp b/source/games/exhumed/src/spider.cpp index f4e3f568e..519a295aa 100644 --- a/source/games/exhumed/src/spider.cpp +++ b/source/games/exhumed/src/spider.cpp @@ -54,9 +54,9 @@ DExhumedActor* BuildSpider(DExhumedActor* spp, const DVector3& pos, sectortype* spp->spr.cstat = CSTAT_SPRITE_BLOCK_ALL; spp->spr.shade = -12; spp->spr.clipdist = 15; - spp->clear_xvel(); - spp->clear_yvel(); - spp->clear_zvel(); + spp->vel.X = 0; + spp->vel.Y = 0; + spp->vel.Z = 0; spp->spr.xrepeat = 40; spp->spr.yrepeat = 40; spp->spr.pal = spp->sector()->ceilingpal; @@ -174,7 +174,7 @@ void AISpider::Tick(RunListEvent* ev) if (spp->spr.cstat & CSTAT_SPRITE_YFLIP) { - spp->clear_zvel(); + spp->vel.Z = 0; spp->spr.pos.Z = pSector->ceilingz + (tileHeight(spp->spr.picnum) / 8.); // was << 5 in Build coordinates if (pSector->ceilingstat & CSTAT_SECTOR_SKY) @@ -198,8 +198,8 @@ void AISpider::Tick(RunListEvent* ev) } else { - spp->clear_xvel(); - spp->clear_yvel(); + spp->vel.X = 0; + spp->vel.Y = 0; } if (spp->nAction == 1 && RandomBit()) @@ -256,8 +256,8 @@ void AISpider::Tick(RunListEvent* ev) else { spp->nAction = 0; - spp->clear_xvel(); - spp->clear_yvel(); + spp->vel.X = 0; + spp->vel.Y = 0; } spp->nFrame = 0; @@ -271,8 +271,8 @@ void AISpider::Tick(RunListEvent* ev) spp->nAction = 0; spp->nFrame = 0; - spp->clear_xvel(); - spp->clear_yvel(); + spp->vel.X = 0; + spp->vel.Y = 0; } auto nMov = movesprite(spp, spp->int_xvel() << nVel, spp->int_yvel() << nVel, spp->int_zvel(), 1280, -1280, CLIPMASK0); @@ -287,7 +287,7 @@ void AISpider::Tick(RunListEvent* ev) { spp->spr.cstat |= CSTAT_SPRITE_YFLIP; spp->spr.pos.Z = spp->sector()->ceilingz + GetActorHeightF(spp); - spp->clear_zvel(); + spp->vel.Z = 0; spp->nAction = 1; spp->nFrame = 0; diff --git a/source/games/exhumed/src/wasp.cpp b/source/games/exhumed/src/wasp.cpp index 73328324f..7093a8a59 100644 --- a/source/games/exhumed/src/wasp.cpp +++ b/source/games/exhumed/src/wasp.cpp @@ -74,9 +74,9 @@ DExhumedActor* BuildWasp(DExhumedActor* pActor, const DVector3& pos, sectortype* pActor->spr.yoffset = 0; pActor->spr.picnum = 1; pActor->set_int_ang(nAngle); - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->spr.hitag = 0; pActor->spr.lotag = runlist_HeadRun() + 1; pActor->spr.extra = -1; @@ -243,7 +243,7 @@ void AIWasp::Tick(RunListEvent* ev) else { pActor->angle2 = 0; - pActor->clear_zvel(); + pActor->vel.Z = 0; pActor->nAction = 1; pActor->nFrame = 0; pActor->nVel = 1500; @@ -287,8 +287,8 @@ void AIWasp::Tick(RunListEvent* ev) { if (nChaseVal.actor() == pTarget) { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; runlist_DamageEnemy(pTarget, pActor, pActor->nDamage); pActor->nAction = 2; pActor->nFrame = 0; @@ -320,8 +320,8 @@ void AIWasp::Tick(RunListEvent* ev) //if (nMove.type != kHitNone) // The code messed up the return value so this check always was true. { - pActor->clear_xvel(); - pActor->clear_yvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; pActor->set_int_zvel(1024); pActor->nAction = 5; pActor->nFrame = 0; @@ -343,9 +343,9 @@ void AIWasp::Tick(RunListEvent* ev) pActor->spr.cstat |= CSTAT_SPRITE_INVISIBLE; } - pActor->clear_xvel(); - pActor->clear_yvel(); - pActor->clear_zvel(); + pActor->vel.X = 0; + pActor->vel.Y = 0; + pActor->vel.Z = 0; pActor->nAction = 6; pActor->nFrame = 0; runlist_SubRunRec(pActor->nRun); diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index e1fc911af..148e317bc 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -167,7 +167,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) if (RandomRange(1000) > 500) actor->spr.cstat |= (CSTAT_SPRITE_YFLIP); ChangeState(actor, actor->user.StateEnd); - actor->clear_xvel(); + actor->vel.X = 0; actor->user.jump_speed = 0; DoActorBeginJump(actor); } @@ -205,7 +205,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) } else { - actor->clear_xvel(); + actor->vel.X = 0; actor->user.jump_speed = -10 - RandomRange(25); DoActorBeginJump(actor); } diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index 02ae19ba8..9fd4178f6 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -437,7 +437,7 @@ int DoBloodSpray(DSWActor* actor) return 0; } - actor->clear_xvel(); + actor->vel.X = 0; actor->user.change.X = actor->user.change.Y = 0; actor->spr.xrepeat = actor->spr.yrepeat = 70 - RandomRange(25); actor->spr.pos.XY() = bldActor->spr.pos.XY(); @@ -1332,8 +1332,8 @@ int InitChemBomb(DSWActor* actor) if (actor->user.ID == MUSHROOM_CLOUD || actor->user.ID == 3121 || actor->user.ID == SUMO_RUN_R0) // 3121 == GRENADE_EXP { actor->user.change.Zero(); - actorNew->clear_xvel(); - actorNew->clear_zvel(); + actorNew->vel.X = 0; + actorNew->vel.Z = 0; // Smoke will come out for this many seconds actorNew->user.WaitTics = 40*120; } diff --git a/source/games/sw/src/miscactr.cpp b/source/games/sw/src/miscactr.cpp index dc7694b6a..ca90cff1e 100644 --- a/source/games/sw/src/miscactr.cpp +++ b/source/games/sw/src/miscactr.cpp @@ -131,8 +131,8 @@ int SetupToiletGirl(DSWActor* actor) actor->spr.xrepeat = 38; actor->spr.yrepeat = 32; - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; actor->spr.lotag = TOILETGIRL_R0; actor->user.FlagOwner = 0; actor->user.ID = TOILETGIRL_R0; @@ -190,8 +190,8 @@ int DoToiletGirl(DSWActor* actor) // take damage from environment DoActorSectorDamage(actor); - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; return 0; } @@ -353,8 +353,8 @@ int SetupWashGirl(DSWActor* actor) actor->spr.xrepeat = 28; actor->spr.yrepeat = 24; - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; actor->spr.lotag = WASHGIRL_R0; actor->user.FlagOwner = 0; actor->user.ID = WASHGIRL_R0; @@ -421,8 +421,8 @@ int DoWashGirl(DSWActor* actor) // take damage from environment DoActorSectorDamage(actor); - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; return 0; } @@ -549,8 +549,8 @@ int SetupTrashCan(DSWActor* actor) actor->spr.xrepeat = 46; actor->spr.yrepeat = 42; - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; actor->user.ID = TRASHCAN; actor->user.Flags &= ~(SPR_XFLIP_TOGGLE); @@ -570,8 +570,8 @@ int DoTrashCan(DSWActor* actor) KeepActorOnFloor(actor); } - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; return 0; } @@ -642,8 +642,8 @@ int SetupPachinkoLight(DSWActor* actor) actor->user.RotNum = 0; actor->user.ID = PACHINKOLIGHT_R0; - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; actor->spr.lotag = TAG_PACHINKOLIGHT; actor->spr.shade = -2; actor->user.spal = actor->spr.pal; @@ -733,7 +733,7 @@ int SetupPachinko1(DSWActor* actor) actor->user.RotNum = 0; actor->user.ID = PACHINKO1; - actor->clear_zvel(); + actor->vel.Z = 0; actor->spr.lotag = PACHINKO1; actor->user.Flags &= ~(SPR_XFLIP_TOGGLE); @@ -885,7 +885,7 @@ int SetupPachinko2(DSWActor* actor) actor->user.RotNum = 0; actor->user.ID = PACHINKO2; - actor->clear_zvel(); + actor->vel.Z = 0; actor->spr.lotag = PACHINKO2; actor->user.Flags &= ~(SPR_XFLIP_TOGGLE); @@ -961,7 +961,7 @@ int SetupPachinko3(DSWActor* actor) actor->user.RotNum = 0; actor->user.ID = PACHINKO3; - actor->clear_zvel(); + actor->vel.Z = 0; actor->spr.lotag = PACHINKO3; actor->user.Flags &= ~(SPR_XFLIP_TOGGLE); @@ -1038,7 +1038,7 @@ int SetupPachinko4(DSWActor* actor) actor->user.RotNum = 0; actor->user.ID = PACHINKO4; - actor->clear_zvel(); + actor->vel.Z = 0; actor->spr.lotag = PACHINKO4; actor->user.Flags &= ~(SPR_XFLIP_TOGGLE); @@ -1145,8 +1145,8 @@ int SetupCarGirl(DSWActor* actor) actor->spr.xrepeat = 29; actor->spr.yrepeat = 25; - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; actor->spr.lotag = CARGIRL_R0; actor->user.FlagOwner = 0; actor->user.ID = CARGIRL_R0; @@ -1196,8 +1196,8 @@ int DoCarGirl(DSWActor* actor) // take damage from environment DoActorSectorDamage(actor); - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; return 0; } @@ -1348,8 +1348,8 @@ int SetupMechanicGirl(DSWActor* actor) actor->spr.xrepeat = 27; actor->spr.yrepeat = 26; - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; actor->spr.lotag = MECHANICGIRL_R0; actor->user.FlagOwner = 0; actor->user.ID = MECHANICGIRL_R0; @@ -1398,8 +1398,8 @@ int DoMechanicGirl(DSWActor* actor) // take damage from environment DoActorSectorDamage(actor); - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; return 0; } @@ -1550,8 +1550,8 @@ int SetupSailorGirl(DSWActor* actor) actor->spr.xrepeat = 28; actor->spr.yrepeat = 26; - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; actor->spr.lotag = SAILORGIRL_R0; actor->user.FlagOwner = 0; actor->user.ID = SAILORGIRL_R0; @@ -1605,8 +1605,8 @@ int DoSailorGirl(DSWActor* actor) // take damage from environment DoActorSectorDamage(actor); - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; return 0; } @@ -1746,8 +1746,8 @@ int SetupPruneGirl(DSWActor* actor) actor->spr.xrepeat = 33; actor->spr.yrepeat = 28; - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; actor->spr.lotag = PRUNEGIRL_R0; actor->user.FlagOwner = 0; actor->user.ID = PRUNEGIRL_R0; @@ -1812,8 +1812,8 @@ int DoPruneGirl(DSWActor* actor) // take damage from environment DoActorSectorDamage(actor); - actor->clear_xvel(); - actor->clear_zvel(); + actor->vel.X = 0; + actor->vel.Z = 0; return 0; } diff --git a/source/games/sw/src/ninja.cpp b/source/games/sw/src/ninja.cpp index dc912a47f..1d724dab8 100644 --- a/source/games/sw/src/ninja.cpp +++ b/source/games/sw/src/ninja.cpp @@ -1974,7 +1974,7 @@ int DoNinjaGrabThroat(DSWActor* actor) ChangeState(actor, actor->user.StateEnd); - actor->clear_xvel(); + actor->vel.X = 0; PlaySound(DIGI_NINJASCREAM, actor, v3df_follow); } diff --git a/source/games/sw/src/skull.cpp b/source/games/sw/src/skull.cpp index 4adcc5229..81d3e691e 100644 --- a/source/games/sw/src/skull.cpp +++ b/source/games/sw/src/skull.cpp @@ -440,7 +440,7 @@ int DoSkullWait(DSWActor* actor) // look for closest player every once in a while if (dist < 3500) { - actor->clear_xvel(); + actor->vel.X = 0; actor->user.jump_speed = -600; NewStateGroup(actor, sg_SkullJump); DoBeginJump(actor); @@ -802,7 +802,7 @@ int DoBettyWait(DSWActor* actor) // look for closest player every once in a while if (dist < 3500) { - actor->clear_xvel(); + actor->vel.X = 0; actor->user.jump_speed = -600; NewStateGroup(actor, sg_BettyJump); DoBeginJump(actor); diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 824fd8d6b..5975acafb 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -1827,7 +1827,7 @@ void SpriteSetup(void) { // if moves with SO if (TEST_BOOL1(actor)) - actor->clear_xvel(); + actor->vel.X = 0; else actor->set_int_xvel(actor->spr.lotag); @@ -1841,7 +1841,7 @@ void SpriteSetup(void) { // if moves with SO if (TEST_BOOL1(actor)) - actor->clear_xvel(); + actor->vel.X = 0; else actor->set_int_xvel(actor->spr.lotag); StartInterpolation(actor->sector(), Interp_Sect_CeilingPanX); @@ -1867,7 +1867,7 @@ void SpriteSetup(void) actor->tempwall = hit.hitWall; // if moves with SO if (TEST_BOOL1(actor)) - actor->clear_xvel(); + actor->vel.X = 0; else actor->set_int_xvel(actor->spr.lotag); actor->set_int_ang(SP_TAG6(actor)); @@ -4971,7 +4971,7 @@ int DoGet(DSWActor* actor) { if (!DoItemFly(actor)) { - actor->clear_xvel(); + actor->vel.X = 0; change_actor_stat(actor, STAT_ITEM); } } diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index f7bf2d86e..34be20e1e 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -3224,7 +3224,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) { actor->user.Flags &= ~(SPR_ZDIFF_MODE); actor->spr.pos.Z = actor->sector()->floorz; - actor->clear_zvel(); + actor->vel.Z = 0; } else { @@ -3442,7 +3442,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) { actor->user.Flags &= ~(SPR_CLIMBING); - actor->clear_zvel(); + actor->vel.Z = 0; actor->spr.angle = VecToAngle(tpoint->pos - actor->spr.pos); diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 54d93c42a..6f3436a28 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -10848,7 +10848,7 @@ int DoMirv(DSWActor* actor) actorNew->spr.xrepeat = 40; actorNew->spr.yrepeat = 40; actorNew->spr.clipdist = 32L >> 2; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); actorNew->user.ceiling_dist = (16); @@ -11063,7 +11063,7 @@ void InitSpellRing(PLAYER* pp) actorNew->spr.shade = -40; actorNew->spr.xrepeat = 32; actorNew->spr.yrepeat = 32; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->user.pos.Z = 20; actorNew->user.Dist = RING_INNER_DIST; @@ -11223,7 +11223,7 @@ int InitLavaThrow(DSWActor* actor) actorNew->spr.yrepeat = 72; actorNew->spr.xrepeat = 72; actorNew->spr.shade = -15; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.angle = actor->spr.angle; if (RANDOM_P2(1024) > 512) @@ -13769,7 +13769,7 @@ int InitSerpSpell(DSWActor* actor) actorNew->spr.xrepeat = 64; actorNew->spr.yrepeat = 64; actorNew->spr.clipdist = 32L >> 2; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); actorNew->user.ceiling_dist = (16); @@ -13860,7 +13860,7 @@ int InitSerpMonstSpell(DSWActor* actor) actorNew->spr.xrepeat = 122; actorNew->spr.yrepeat = 116; actorNew->spr.clipdist = 32L >> 2; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); actorNew->user.ceiling_dist = (16); @@ -13926,7 +13926,7 @@ int InitEnemyRocket(DSWActor* actor) actorNew->spr.yrepeat = 28; actorNew->spr.xrepeat = 28; actorNew->spr.shade = -15; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.angle = actor->spr.angle; actorNew->spr.clipdist = 64L>>2; @@ -13995,7 +13995,7 @@ int InitEnemyRail(DSWActor* actor) actorNew->spr.yrepeat = 52; actorNew->spr.xrepeat = 52; actorNew->spr.shade = -15; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->user.RotNum = 5; NewStateGroup(actorNew, &sg_Rail[0]); @@ -14054,7 +14054,7 @@ int InitZillaRocket(DSWActor* actor) actorNew->spr.yrepeat = 28; actorNew->spr.xrepeat = 28; actorNew->spr.shade = -15; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.angle = actor->spr.angle; actorNew->spr.clipdist = 64 >>2; @@ -14105,7 +14105,7 @@ int InitEnemyStar(DSWActor* actor) actorNew->spr.yrepeat = 16; actorNew->spr.xrepeat = 16; actorNew->spr.shade = -25; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.angle = actor->spr.angle; actorNew->spr.clipdist = 64L>>2; @@ -14135,7 +14135,7 @@ int InitEnemyCrossbow(DSWActor* actor) actorNew->spr.xrepeat = 16; actorNew->spr.yrepeat = 26; actorNew->spr.shade = -25; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.angle = actor->spr.angle; actorNew->spr.clipdist = 64>>2; @@ -14172,7 +14172,7 @@ int InitSkelSpell(DSWActor* actor) actorNew->spr.xrepeat -= 20; actorNew->spr.yrepeat -= 20; actorNew->spr.shade = -40; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.angle = actor->spr.angle; actorNew->spr.clipdist = 64L>>2; actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); @@ -14207,7 +14207,7 @@ int InitCoolgFire(DSWActor* actor) actorNew->spr.yrepeat = 18; actorNew->spr.xrepeat = 18; actorNew->spr.shade = -40; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.angle = actor->spr.angle; actorNew->spr.clipdist = 32>>2; actorNew->user.ceiling_dist = (4); @@ -14255,7 +14255,7 @@ int InitCoolgDrip(DSWActor* actor) SetOwner(actor, actorNew); actorNew->spr.yrepeat = actorNew->spr.xrepeat = 20; actorNew->spr.shade = -5; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.clipdist = 16L>>2; actorNew->user.ceiling_dist = (4); actorNew->user.floor_dist = (4); @@ -14288,7 +14288,7 @@ int GenerateDrips(DSWActor* actor) SetOwner(actor, actorNew); actorNew->spr.yrepeat = actorNew->spr.xrepeat = 20; actorNew->spr.shade = -10; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.clipdist = 16L>>2; actorNew->user.ceiling_dist = (4); actorNew->user.floor_dist = (4); @@ -14350,7 +14350,7 @@ void InitFireballTrap(DSWActor* actor) actorNew->spr.yrepeat -= 20; actorNew->spr.shade = -40; actorNew->spr.clipdist = 32>>2; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); actorNew->user.WeaponNum = WPN_HOTHEAD; @@ -14370,7 +14370,7 @@ void InitBoltTrap(DSWActor* actor) actorNew->spr.yrepeat = 32; actorNew->spr.xrepeat = 32; actorNew->spr.shade = -15; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.cstat |= (CSTAT_SPRITE_YCENTER); actorNew->user.RotNum = 5; @@ -14438,7 +14438,7 @@ int InitTracerUzi(PLAYER* pp) actorNew->spr.yrepeat = 10; actorNew->spr.xrepeat = 10; actorNew->spr.shade = -40; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.clipdist = 32 >> 2; actorNew->user.WeaponNum = actor->user.WeaponNum; @@ -14497,7 +14497,7 @@ int InitTracerTurret(DSWActor* actor, DSWActor* Operator, fixed_t q16horiz) actorNew->spr.yrepeat = 10; actorNew->spr.xrepeat = 10; actorNew->spr.shade = -40; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.clipdist = 8 >> 2; actorNew->user.WeaponNum = actor->user.WeaponNum; @@ -14533,7 +14533,7 @@ int InitTracerAutoTurret(DSWActor* actor, int xchange, int ychange, int zchange) actorNew->spr.yrepeat = 10; actorNew->spr.xrepeat = 10; actorNew->spr.shade = -40; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.clipdist = 8 >> 2; actorNew->user.WeaponNum = actor->user.WeaponNum; @@ -14881,7 +14881,7 @@ int InitTankShell(DSWActor* actor, PLAYER* pp) actorNew->spr.yrepeat = 8; actorNew->spr.xrepeat = 8; actorNew->spr.shade = -40; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.clipdist = 32 >> 2; actorNew->user.WeaponNum = actor->user.WeaponNum; @@ -15014,7 +15014,7 @@ int InitTurretRocket(DSWActor* actor, PLAYER* pp) actorNew->spr.yrepeat = 40; actorNew->spr.xrepeat = 40; actorNew->spr.shade = -40; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.clipdist = 32 >> 2; actorNew->user.WeaponNum = actor->user.WeaponNum; @@ -15048,7 +15048,7 @@ int InitTurretFireball(DSWActor* actor, PLAYER* pp) actorNew->spr.yrepeat = 40; actorNew->spr.xrepeat = 40; actorNew->spr.shade = -40; - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.clipdist = 32 >> 2; actorNew->user.WeaponNum = actor->user.WeaponNum; @@ -16162,7 +16162,7 @@ int InitEnemyFireball(DSWActor* actor) actorNew->spr.shade = -40; SetOwner(actor, actorNew); - actorNew->clear_zvel(); + actorNew->vel.Z = 0; actorNew->spr.clipdist = 16>>2; actorNew->set_int_ang(NORM_ANGLE(actorNew->int_ang() + lat_ang[i])); @@ -17758,7 +17758,7 @@ int DoItemFly(DSWActor* actor) { actor->spr.pos.Z = actor->user.loz; actor->user.Counter = 0; - actor->clear_xvel(); + actor->vel.X = 0; actor->user.change.Zero(); return false; }