From 2e947fded37ee84339b55902e8c100752da35f17 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 Sep 2022 19:29:29 +0200 Subject: [PATCH] - trivial changes --- source/games/duke/src/actors.cpp | 10 +++++----- source/games/duke/src/actors_d.cpp | 13 ++++++------- source/games/duke/src/actors_r.cpp | 10 +++++----- source/games/duke/src/game_misc.cpp | 2 +- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index c42c67114..b665abfa0 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -649,7 +649,7 @@ void movecrane(DDukeActor *actor, int crane) else if (actor->temp_data[0] == 1) { - if (actor->int_xvel() < 184) + if (actor->vel.X < 11.5) { actor->spr.picnum = crane + 1; actor->vel.X += 0.5; @@ -746,7 +746,7 @@ void movecrane(DDukeActor *actor, int crane) } else if (actor->temp_data[0] == 6) { - if (actor->int_xvel() < 192) + if (actor->vel.X < 12) actor->vel.X += 0.5; actor->spr.angle = VecToAngle(cpt.pos.XY() - actor->spr.pos.XY()); ssp(actor, CLIPMASK0); @@ -1423,11 +1423,11 @@ bool rat(DDukeActor* actor, bool makesound) deletesprite(actor); return false; } - else actor->set_int_ang((krand() & 2047)); + else actor->spr.angle = randomAngle(); } - if (actor->int_xvel() < 128) + if (actor->vel.X < 8) actor->vel.X += 1/8.; - actor->add_int_ang((krand() & 3) - 6); + actor->spr.angle += mapangle((krand() & 3) - 6); return true; } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 70e3d00cd..9ca476e9c 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -754,7 +754,7 @@ void movefallers_d(void) } else { - if (act->int_xvel() > 0) + if (act->vel.X > 0) { act->vel.X -= 0.5; ssp(act, CLIPMASK0); @@ -2213,7 +2213,7 @@ static void greenslime(DDukeActor *actor) return; } - else if (actor->int_xvel() < 64 && x < 768) + else if (actor->vel.X < 4 && x < 768) { if (ps[p].somethingonplayer == nullptr) { @@ -2355,18 +2355,17 @@ static void greenslime(DDukeActor *actor) if (everyothertime & 1) ssp(actor, CLIPMASK0); - if (actor->int_xvel() > 96) + if (actor->vel.X > 6) { actor->vel.X -= 1/8.; return; } else { - if (actor->int_xvel() < 32) actor->vel.X += 0.25; + if (actor->vel.X < 2) actor->vel.X += 0.25; actor->set_int_xvel(64 - bcos(actor->temp_data[1], -9)); - actor->add_int_ang(getincangle(actor->int_ang(), - getangle(ps[p].pos.XY() - actor->spr.pos.XY())) >> 3); + actor->spr.angle += deltaangle(actor->spr.angle, VecToAngle(ps[p].pos.XY() - actor->spr.pos.XY())) * 0.125; // TJR } @@ -2689,7 +2688,7 @@ DETONATEB: } } } - else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->int_xvel() == 0) + else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->vel.X == 0) if (cansee(actor->spr.pos.plusZ(-8), actor->sector(), ps[p].pos, ps[p].cursector)) if (ps[p].ammo_amount[HANDBOMB_WEAPON] < gs.max_ammo_amount[HANDBOMB_WEAPON]) { diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 1c0310ba6..8a6d6f8da 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -671,7 +671,7 @@ void movefallers_r(void) } else { - if (act->int_xvel() > 0) + if (act->vel.X > 0) { act->vel.X -= 1/8.; ssp(act, CLIPMASK0); @@ -1336,7 +1336,7 @@ void moveweapons_r(void) continue; case FREEZEBLAST: - if (proj->spr.yint < 1 || proj->spr.extra < 2 || (proj->int_xvel() == 0 && proj->int_zvel() == 0)) + if (proj->spr.yint < 1 || proj->spr.extra < 2 || (proj->vel.X == 0 && proj->vel.Z == 0)) { auto star = spawn(proj, TRANSPORTERSTAR); if (star) @@ -2472,7 +2472,7 @@ DETONATEB: return; } } - else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->int_xvel() == 0) + else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->vel.X == 0) if (cansee(actor->spr.pos.plusZ(-8), actor->sector(), ps[p].pos, ps[p].cursector)) if (ps[p].ammo_amount[DYNAMITE_WEAPON] < gs.max_ammo_amount[DYNAMITE_WEAPON]) if (actor->spr.pal == 0) @@ -2582,10 +2582,10 @@ static int henstand(DDukeActor *actor) actor->spr.cstat |= CSTAT_SPRITE_YFLIP & ESpriteFlags::FromInt(int(actor->vel.X * 16)); if (krand() & 1) actor->spr.picnum = HENSTAND + 1; - if (!actor->int_xvel()) + if (actor->vel.X == 0) return 2;//deletesprite(actor); still needs to run a script but should not do on a deleted object } - if (actor->spr.picnum == BOWLINGPIN || (actor->spr.picnum == BOWLINGPIN + 1 && !actor->int_xvel())) + if (actor->spr.picnum == BOWLINGPIN || (actor->spr.picnum == BOWLINGPIN + 1 && actor->vel.X == 0)) { return 2;//deletesprite(actor); still needs to run a script but should not do on a deleted object } diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 61a548de6..af596595f 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -429,7 +429,7 @@ bool GameInterface::DrawAutomapPlayer(const DVector2& mxy, const DVector2& cpos, { auto& pp = ps[p]; auto act = pp.GetActor(); - int i = TILE_APLAYERTOP + (act->int_xvel() > 16 && pp.on_ground ? (PlayClock >> 4) & 3 : 0); + int i = TILE_APLAYERTOP + (act->vel.X > 1 && pp.on_ground ? (PlayClock >> 4) & 3 : 0); double j = clamp(czoom * act->spr.yrepeat + abs(pp.truefz - pp.pos.Z), 21.5, 128.) * REPEAT_SCALE; auto const vec = OutAutomapVector(mxy - cpos, cangvect, czoom, xydim);