From aac5ab55a33cb821f57bcb0ad6511f739503c508 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 4 Nov 2020 19:09:38 +0100 Subject: [PATCH] - movesprite cleanup. --- source/games/duke/src/actors_d.cpp | 8 ++++---- source/games/duke/src/actors_r.cpp | 6 +++--- source/games/duke/src/player_d.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 7c54dfd8f..099578e80 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -603,10 +603,10 @@ int movesprite_ex_d(DDukeActor* actor, int xchange, int ychange, int zchange, un { if (spri->statnum == STAT_PROJECTILE) retval = - clipmove(&spri->x, &spri->y, &daz, &dasectnum, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), 8L, (4 << 8), (4 << 8), cliptype); + clipmove_ex(&spri->x, &spri->y, &daz, &dasectnum, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), 8L, (4 << 8), (4 << 8), cliptype, result); else retval = - clipmove(&spri->x, &spri->y, &daz, &dasectnum, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), (int)(spri->clipdist << 2), (4 << 8), (4 << 8), cliptype); + clipmove_ex(&spri->x, &spri->y, &daz, &dasectnum, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), (int)(spri->clipdist << 2), (4 << 8), (4 << 8), cliptype, result); } if (dasectnum >= 0) @@ -615,10 +615,10 @@ int movesprite_ex_d(DDukeActor* actor, int xchange, int ychange, int zchange, un daz = spri->z + ((zchange * TICSPERFRAME) >> 3); if ((daz > actor->ceilingz) && (daz <= actor->floorz)) spri->z = daz; - else if (retval == 0) + else if (retval == kHitNone) return result.setSector(dasectnum); - return result.setFromEngine(retval); + return retval; } //--------------------------------------------------------------------------- // diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 77b4c8044..22cef085b 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -433,10 +433,10 @@ int movesprite_ex_r(DDukeActor* actor, int xchange, int ychange, int zchange, un { if (spri->statnum == STAT_PROJECTILE) retval = - clipmove(&spri->x, &spri->y, &daz, &dasectnum, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), 8L, (4 << 8), (4 << 8), cliptype); + clipmove_ex(&spri->x, &spri->y, &daz, &dasectnum, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), 8L, (4 << 8), (4 << 8), cliptype, result); else retval = - clipmove(&spri->x, &spri->y, &daz, &dasectnum, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), 128, (4 << 8), (4 << 8), cliptype); + clipmove_ex(&spri->x, &spri->y, &daz, &dasectnum, ((xchange * TICSPERFRAME) << 11), ((ychange * TICSPERFRAME) << 11), 128, (4 << 8), (4 << 8), cliptype, result); } if (dasectnum >= 0) @@ -448,7 +448,7 @@ int movesprite_ex_r(DDukeActor* actor, int xchange, int ychange, int zchange, un else if (retval == 0) return result.setSector(dasectnum); - return result.setFromEngine(retval); + return retval; } //--------------------------------------------------------------------------- diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 304c21f8f..20ace7832 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -3066,8 +3066,8 @@ HORIZONLY: psect = s->sectnum; if (ud.clipping == 0 && sector[psect].lotag == 31) { - auto secact = &hittype[sector[psect].hitag]; - if (secact->s.xvel && secact->temp_data[0] == 0) + auto secact = ScriptIndexToActor(sector[psect].hitag); + if (secact && secact->s.xvel && secact->temp_data[0] == 0) { quickkill(p); return;