From 643dda6085b90486ebf7c5571201ce296a789e6b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 1 Sep 2022 17:06:17 +0200 Subject: [PATCH] -add_int_xvel(- --- source/games/duke/src/actors.cpp | 12 ++++++------ source/games/duke/src/actors_d.cpp | 10 +++++----- source/games/duke/src/actors_r.cpp | 8 ++++---- source/games/exhumed/src/mummy.cpp | 2 +- source/games/exhumed/src/object.cpp | 2 +- source/games/sw/src/jweapon.cpp | 4 ++-- source/games/sw/src/weapon.cpp | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 9fa13d470..8be6d1de3 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1029,7 +1029,7 @@ void movewaterdrip(DDukeActor *actor, int drip) { makeitfall(actor); ssp(actor, CLIPMASK0); - if(actor->float_xvel() > 0) actor->spr.xvel -= 2; + if(actor->float_xvel() > 0) actor->add_int_xvel(-2); if (actor->float_zvel() == 0) { @@ -1686,7 +1686,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p else if (actor->temp_data[0] == 2 || actor->temp_data[0] == 3) { actor->temp_data[3] = 0; - if(actor->float_xvel() > 0) actor->spr.xvel -= 16; + if(actor->float_xvel() > 0) actor->add_int_xvel(-16); else actor->clear_xvel(); if (actor->temp_data[0] == 2) @@ -1733,7 +1733,7 @@ void recon(DDukeActor *actor, int explosion, int firelaser, int attacksnd, int p if (l > 1524) { if (actor->int_xvel() < 256) actor->add_int_xvel( 32); } else { - if(actor->float_xvel() > 0) actor->spr.xvel -= 16; + if(actor->float_xvel() > 0) actor->add_int_xvel(-16); else actor->clear_xvel(); } } @@ -2384,7 +2384,7 @@ void shell(DDukeActor* actor, bool morecheck) if (actor->float_zvel() < 0.5) actor->add_int_zvel( (gs.gravity / 13)); // 8 else actor->add_int_zvel(- 64); if(actor->float_xvel() > 0) - actor->spr.xvel -= 4; + actor->add_int_xvel(-4); else actor->clear_xvel(); } else @@ -2444,7 +2444,7 @@ void glasspieces(DDukeActor* actor) if(actor->float_xvel() > 0) { - actor->spr.xvel -= 2; + actor->add_int_xvel(-2); static const ESpriteFlags flips[] = { 0, CSTAT_SPRITE_XFLIP, CSTAT_SPRITE_YFLIP, CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP }; actor->spr.cstat = flips[actor->spr.xvel & 3]; } @@ -2968,7 +2968,7 @@ void handle_se30(DDukeActor *actor, int JIBS6) actor->clear_xvel(); if(actor->float_xvel() > 0) - actor->spr.xvel -= 16; + actor->add_int_xvel(-16); else { actor->clear_xvel(); diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index a5c21d2f5..a387dcaf8 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -757,7 +757,7 @@ void movefallers_d(void) { if (act->int_xvel() > 0) { - act->spr.xvel -= 8; + act->add_int_xvel(-8); ssp(act, CLIPMASK0); } @@ -2369,7 +2369,7 @@ static void greenslime(DDukeActor *actor) if (actor->int_xvel() > 96) { - actor->spr.xvel -= 2; + actor->add_int_xvel(-2); return; } else @@ -2628,9 +2628,9 @@ static void heavyhbomb(DDukeActor *actor) if(actor->float_xvel() > 0) { - actor->spr.xvel -= 5; + actor->add_int_xvel(-5); if (sectp->lotag == 2) - actor->spr.xvel -= 10; + actor->add_int_xvel(-10); if(actor->float_xvel() < 0) actor->clear_xvel(); @@ -3164,7 +3164,7 @@ void handle_se06_d(DDukeActor* actor) { actor->temp_data[4]--; if (actor->temp_data[4] >= (k - (k >> 3))) - actor->spr.xvel -= (k >> 5); + actor->add_int_xvel(-(k >> 5)); if (actor->temp_data[4] > ((k >> 1) - 1) && actor->temp_data[4] < (k - (k >> 3))) actor->clear_xvel(); if (actor->temp_data[4] < (k >> 1)) diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 2053dd110..e05e93046 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -674,7 +674,7 @@ void movefallers_r(void) { if (act->int_xvel() > 0) { - act->spr.xvel -= 2; + act->add_int_xvel(-2); ssp(act, CLIPMASK0); } @@ -2416,9 +2416,9 @@ static void heavyhbomb(DDukeActor *actor) if(actor->float_xvel() > 0) { - actor->spr.xvel -= 5; + actor->add_int_xvel(-5); if (sectp->lotag == 2) - actor->spr.xvel -= 10; + actor->add_int_xvel(-10); if(actor->float_xvel() < 0) actor->clear_xvel(); @@ -3151,7 +3151,7 @@ void handle_se06_r(DDukeActor *actor) { actor->temp_data[4]--; if (actor->temp_data[4] >= (k - (k >> 3))) - actor->spr.xvel -= (k >> 5); + actor->add_int_xvel(-(k >> 5)); if (actor->temp_data[4] > ((k >> 1) - 1) && actor->temp_data[4] < (k - (k >> 3))) actor->clear_xvel(); if (actor->temp_data[4] < (k >> 1)) diff --git a/source/games/exhumed/src/mummy.cpp b/source/games/exhumed/src/mummy.cpp index f2e4338c3..fa877c7ce 100644 --- a/source/games/exhumed/src/mummy.cpp +++ b/source/games/exhumed/src/mummy.cpp @@ -226,7 +226,7 @@ void AIMummy::Tick(RunListEvent* ev) { if (pActor->int_xvel() > 0) { - pActor->spr.xvel -= 1024; + pActor->add_int_xvel(-1024); if (pActor->int_xvel() < 0) { pActor->clear_xvel(); } diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 7bed683ad..a433e3215 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -1896,7 +1896,7 @@ void AIObject::Tick(RunListEvent* ev) if (nMov.exbits & kHitAux2) { - pActor->spr.xvel -= pActor->int_xvel() >> 3; + pActor->add_int_xvel(-pActor->int_xvel() >> 3); pActor->spr.yvel -= pActor->spr.yvel >> 3; } diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index cf96b4f04..2ce3c6c87 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1227,7 +1227,7 @@ int PlayerInitChemBomb(PLAYER* pp) // don't throw it as far if crawling if (pp->Flags & (PF_CRAWLING)) { - actorNew->spr.xvel -= (actorNew->int_xvel() >> 2); + actorNew->add_int_xvel(-(actorNew->int_xvel() >> 2)); } // actorNew->user.RotNum = 5; @@ -1578,7 +1578,7 @@ int PlayerInitCaltrops(PLAYER* pp) // don't throw it as far if crawling if (pp->Flags & (PF_CRAWLING)) { - actorNew->spr.xvel -= (actorNew->int_xvel() >> 2); + actorNew->add_int_xvel(-(actorNew->int_xvel() >> 2)); } actorNew->user.Flags |= (SPR_XFLIP_TOGGLE); diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 3828f5b42..c769c5736 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -15865,7 +15865,7 @@ int InitGrenade(PLAYER* pp) // don't throw it as far if crawling if (pp->Flags & (PF_CRAWLING)) { - actorNew->spr.xvel -= (actorNew->int_xvel() >> 2); + actorNew->add_int_xvel(-(actorNew->int_xvel() >> 2)); } actorNew->user.RotNum = 5;