diff --git a/source/games/sw/src/coolie.cpp b/source/games/sw/src/coolie.cpp index 1634054d8..86cde8a71 100644 --- a/source/games/sw/src/coolie.cpp +++ b/source/games/sw/src/coolie.cpp @@ -410,8 +410,8 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso actor->user.zclip = Z(48); actor->user.lo_step = Z(32); - actor->user.floor_dist = (actor->user.zclip - actor->user.lo_step) * zinttoworld; - actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.zclip) * zinttoworld; + actor->user.floor_dist = (actor->user.int_zclip() - actor->user.lo_step) * zinttoworld; + actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.int_zclip()) * zinttoworld; actor->user.Radius = 400; diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index b3b577053..e2955040b 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -936,6 +936,7 @@ struct USER int int_z_tgt() const { return z_tgt * zworldtoint; } int int_ceiling_dist() const { return ceiling_dist * zworldtoint; } int int_floor_dist() const { return floor_dist * zworldtoint; } + int int_zclip() const { return zclip/* * zworldtoint*/; } // // Variables that can be used by actors and Player @@ -967,6 +968,7 @@ struct USER TObjPtr flagOwnerActor; TObjPtr WpnGoalActor; + double hiz, loz; double oz; // serialized copy of sprite.oz double z_tgt; double ceiling_dist; @@ -993,7 +995,6 @@ struct USER // clipmove int16_t lo_step; - double hiz, loz; int zclip; // z height to move up for clipmove int active_range; sectortype* hi_sectp, *lo_sectp; diff --git a/source/games/sw/src/hornet.cpp b/source/games/sw/src/hornet.cpp index 176882d69..e07c6bf65 100644 --- a/source/games/sw/src/hornet.cpp +++ b/source/games/sw/src/hornet.cpp @@ -490,7 +490,7 @@ int DoHornetDeath(DSWActor* actor) if (actor->user.Flags & (SPR_FALLING)) { - actor->user.loz = actor->user.zclip * zinttoworld; + actor->user.loz = actor->user.int_zclip() * zinttoworld; DoFall(actor); } else diff --git a/source/games/sw/src/serp.cpp b/source/games/sw/src/serp.cpp index 6f3a6e77e..15fb29ae6 100644 --- a/source/games/sw/src/serp.cpp +++ b/source/games/sw/src/serp.cpp @@ -737,8 +737,8 @@ int SetupSerp(DSWActor* actor) // size of step can walk off of actor->user.lo_step = Z(40); - actor->user.floor_dist = (actor->user.zclip - actor->user.lo_step) * zinttoworld; - actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.zclip) * zinttoworld; + actor->user.floor_dist = (actor->user.int_zclip() - actor->user.lo_step) * zinttoworld; + actor->user.ceiling_dist = (ActorSizeZ(actor) - actor->user.int_zclip()) * zinttoworld; return 0; } diff --git a/source/games/sw/src/spike.cpp b/source/games/sw/src/spike.cpp index 5adc5b8cb..c8410a339 100644 --- a/source/games/sw/src/spike.cpp +++ b/source/games/sw/src/spike.cpp @@ -232,16 +232,16 @@ void SpikeAlign(DSWActor* actor) if ((int8_t)SP_TAG7(actor) < 0) { if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP)) - alignceilslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.zclip); + alignceilslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip()); else - alignflorslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.zclip); + alignflorslope(actor->sector(), actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip()); } else { if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP)) - SOBJ_AlignCeilingToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.zclip); + SOBJ_AlignCeilingToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip()); else - SOBJ_AlignFloorToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.zclip); + SOBJ_AlignFloorToPoint(&SectorObject[SP_TAG7(actor)], actor->int_pos().X, actor->int_pos().Y, actor->user.int_zclip()); } } diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index 41e82977b..4da9ab8f9 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -2250,7 +2250,7 @@ void SpriteSetup(void) actor->user.zclip = florz; // start off - actor->user.pos.Z = actor->user.zclip; + actor->user.pos.Z = actor->user.int_zclip(); actor->user.z_tgt = actor->spr.pos.Z; if (start_on) { @@ -2261,7 +2261,7 @@ void SpriteSetup(void) } // set orig z - actor->user.oz = actor->user.zclip * zinttoworld; + actor->user.oz = actor->user.int_zclip() * zinttoworld; actor->opos.Z = actor->user.oz; } else @@ -2269,7 +2269,7 @@ void SpriteSetup(void) actor->user.zclip = ceilz; // start off - actor->user.pos.Z = actor->user.zclip; + actor->user.pos.Z = actor->user.int_zclip(); actor->user.z_tgt = actor->spr.pos.Z; if (start_on) { @@ -2280,7 +2280,7 @@ void SpriteSetup(void) } // set orig z - actor->user.oz = actor->user.zclip * zinttoworld; + actor->user.oz = actor->user.int_zclip() * zinttoworld; actor->opos.Z = actor->user.oz; } @@ -6232,7 +6232,7 @@ Collision move_sprite(DSWActor* actor, int xchange, int ychange, int zchange, in else { // move the center point up for moving - zh = actor->user.zclip; + zh = actor->user.int_zclip(); clippos.Z -= zh; } @@ -6426,7 +6426,7 @@ Collision move_missile(DSWActor* actor, int xchange, int ychange, int zchange, i } else { - zh = actor->user.zclip; + zh = actor->user.int_zclip(); clippos.Z -= zh; }