diff --git a/src/actor.h b/src/actor.h index 107198623..8d58a5a6a 100644 --- a/src/actor.h +++ b/src/actor.h @@ -769,7 +769,7 @@ public: // Return starting health adjusted by skill level int SpawnHealth() const; int GetGibHealth() const; - fixed_t GetCameraHeight() const; + double GetCameraHeight() const; inline bool isMissile(bool precise=true) { @@ -1124,15 +1124,18 @@ public: int floorterrain; struct sector_t *ceilingsector; FTextureID ceilingpic; // contacted sec ceilingpic - double radius; + double radius, Height; // for movement checking inline fixed_t _f_radius() const { return FLOAT2FIXED(radius); } + inline fixed_t _f_height() const + { + return FLOAT2FIXED(Height); + } - fixed_t height; // for movement checking - fixed_t projectilepassheight; // height for clipping projectile movement against this actor + double projectilepassheight; // height for clipping projectile movement against this actor SDWORD tics; // state tic counter FState *state; VMFunction *Damage; // For missiles and monster railgun @@ -1406,7 +1409,7 @@ public: } fixed_t _f_Top() const { - return _f_Z() + height; + return _f_Z() + FLOAT2FIXED(Height); } void _f_SetZ(fixed_t newz, bool moving = true) { @@ -1418,19 +1421,11 @@ public: } double Top() const { - return Z() + FIXED2DBL(height); + return Z() + Height; } double Center() const { - return Z() + FIXED2DBL(height/2); - } - double _Height() const - { - return FIXED2DBL(height); - } - double _Radius() const - { - return FIXED2DBL(_f_radius()); + return Z() + Height/2; } double _pushfactor() const { diff --git a/src/b_func.cpp b/src/b_func.cpp index b9dbf4cba..98653ca9e 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -36,7 +36,7 @@ bool DBot::Reachable (AActor *rtarget) if ((rtarget->Sector->ceilingplane.ZatPoint (rtarget) - rtarget->Sector->floorplane.ZatPoint (rtarget)) - < player->mo->height) //Where rtarget is, player->mo can't be. + < player->mo->_f_height()) //Where rtarget is, player->mo can't be. return false; sector_t *last_s = player->mo->Sector; @@ -79,7 +79,7 @@ bool DBot::Reachable (AActor *rtarget) if (!bglobal.IsDangerous (s) && //Any nukage/lava? (floorheight <= (last_z+MAXMOVEHEIGHT) && ((ceilingheight == floorheight && line->special) - || (ceilingheight - floorheight) >= player->mo->height))) //Does it fit? + || (ceilingheight - floorheight) >= player->mo->_f_height()))) //Does it fit? { last_z = floorheight; last_s = s; @@ -492,7 +492,7 @@ angle_t DBot::FireRox (AActor *enemy, ticcmd_t *cmd) bglobal.SetBodyAt (player->mo->_f_X() + FixedMul(player->mo->_f_velx(), 5*FRACUNIT), player->mo->_f_Y() + FixedMul(player->mo->_f_vely(), 5*FRACUNIT), - player->mo->_f_Z() + (player->mo->height / 2), 2); + player->mo->_f_Z() + (player->mo->_f_height() / 2), 2); actor = bglobal.body2; diff --git a/src/b_move.cpp b/src/b_move.cpp index ed3359866..63a0bc623 100644 --- a/src/b_move.cpp +++ b/src/b_move.cpp @@ -270,7 +270,7 @@ bool FCajunMaster::CleanAhead (AActor *thing, fixed_t x, fixed_t y, ticcmd_t *cm if (!(thing->flags & MF_NOCLIP) ) { fixed_t maxstep = thing->MaxStepHeight; - if (tm.ceilingz - tm.floorz < thing->_Height()) + if (tm.ceilingz - tm.floorz < thing->Height) return false; // doesn't fit if (!(thing->flags&MF_MISSILE)) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index ee9b78d64..bf6edaee0 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -903,7 +903,7 @@ static int PatchThing (int thingy) } else if (linelen == 6 && stricmp (Line1, "Height") == 0) { - info->height = val; + info->Height = FIXED2DBL(val); info->projectilepassheight = 0; // needs to be disabled hadHeight = true; } @@ -1257,7 +1257,7 @@ static int PatchThing (int thingy) !hadHeight && thingy <= (int)OrgHeights.Size() && thingy > 0) { - info->height = OrgHeights[thingy - 1] * FRACUNIT; + info->Height = OrgHeights[thingy - 1]; info->projectilepassheight = 0; } // If the thing's shadow changed, change its fuzziness if not already specified diff --git a/src/d_net.cpp b/src/d_net.cpp index 643fa5300..e6ad65800 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2375,7 +2375,7 @@ void Net_DoCommand (int type, BYTE **stream, int player) s = ReadString (stream); if (Trace (players[player].mo->_f_X(), players[player].mo->_f_Y(), - players[player].mo->_f_Top() - (players[player].mo->height>>2), + players[player].mo->_f_Top() - (players[player].mo->_f_height()>>2), players[player].mo->Sector, vx, vy, vz, 172*FRACUNIT, 0, ML_BLOCKEVERYTHING, players[player].mo, trace, TRACE_NoSky)) diff --git a/src/fragglescript/t_func.cpp b/src/fragglescript/t_func.cpp index 46f48a38f..3ac381041 100644 --- a/src/fragglescript/t_func.cpp +++ b/src/fragglescript/t_func.cpp @@ -3207,7 +3207,7 @@ void FParser::SF_MoveCamera(void) } cam->radius = 1 / 8192.; - cam->height=8; + cam->Height = 1 / 8192.; if ((x != cam->_f_X() || y != cam->_f_Y()) && !P_TryMove(cam, x, y, true)) { Printf("Illegal camera move to (%f, %f)\n", x/65536.f, y/65536.f); @@ -3740,7 +3740,7 @@ void FParser::SF_Resurrect() return; mo->SetState(state); - mo->height = mo->GetDefault()->height; + mo->Height = mo->GetDefault()->Height; mo->radius = mo->GetDefault()->radius; mo->flags = mo->GetDefault()->flags; mo->flags2 = mo->GetDefault()->flags2; @@ -4123,11 +4123,9 @@ void FParser::SF_MobjHeight(void) if(t_argc > 1) { if(mo) - mo->height = fixedvalue(t_argv[1]); + mo->Height = floatvalue(t_argv[1]); } - - t_return.type = svt_fixed; - t_return.value.f = mo ? mo->height : 0; + t_return.setDouble(mo ? mo->Height : 0.); } } diff --git a/src/g_doom/a_doommisc.cpp b/src/g_doom/a_doommisc.cpp index 66f7cc7e9..93e7abdaa 100644 --- a/src/g_doom/a_doommisc.cpp +++ b/src/g_doom/a_doommisc.cpp @@ -47,7 +47,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BarrelDestroy) if (dmflags2 & DF2_BARRELS_RESPAWN) { - self->height = self->GetDefault()->height; + self->Height = self->GetDefault()->Height; self->renderflags |= RF_INVISIBLE; self->flags &= ~MF_SOLID; } diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index 90aaa1a4e..22f471482 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -664,7 +664,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray) if (t.linetarget != NULL) { - AActor *spray = Spawn(spraytype, t.linetarget->PosPlusZ(t.linetarget->height >> 2), ALLOW_REPLACE); + AActor *spray = Spawn(spraytype, t.linetarget->PosPlusZ(t.linetarget->Height / 4), ALLOW_REPLACE); int dmgFlags = 0; FName dmgType = NAME_BFGSplash; diff --git a/src/g_doom/a_fatso.cpp b/src/g_doom/a_fatso.cpp index 7cfda4ded..872e1982d 100644 --- a/src/g_doom/a_fatso.cpp +++ b/src/g_doom/a_fatso.cpp @@ -146,7 +146,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom) // Now launch mushroom cloud AActor *target = Spawn("Mapspot", self->Pos(), NO_REPLACE); // We need something to aim at. AActor *master = (flags & MSF_DontHurt) ? (AActor*)(self->target) : self; - target->height = self->height; + target->Height = self->Height; for (i = -n; i <= n; i += 8) { for (j = -n; j <= n; j += 8) diff --git a/src/g_doom/a_revenant.cpp b/src/g_doom/a_revenant.cpp index 221f6dad3..9c8a38602 100644 --- a/src/g_doom/a_revenant.cpp +++ b/src/g_doom/a_revenant.cpp @@ -103,13 +103,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer) // change slope dist = self->DistanceBySpeed(dest, self->Speed); - if (dest->_Height() >= 56.) + if (dest->Height >= 56.) { slope = (dest->Z() + 40. - self->Z()) / dist; } else { - slope = (dest->Z() + self->_Height()*(2./3) - self->Z()) / dist; + slope = (dest->Z() + self->Height*(2./3) - self->Z()) / dist; } if (slope < self->Vel.Z) diff --git a/src/g_heretic/a_dsparil.cpp b/src/g_heretic/a_dsparil.cpp index 92661142b..a978f3097 100644 --- a/src/g_heretic/a_dsparil.cpp +++ b/src/g_heretic/a_dsparil.cpp @@ -273,7 +273,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard) mo = Spawn("Wizard", self->Pos(), ALLOW_REPLACE); if (mo != NULL) { - mo->AddZ(-mo->GetDefault()->_Height() / 2, false); + mo->AddZ(-mo->GetDefault()->Height / 2, false); if (!P_TestMobjLocation (mo)) { // Didn't fit mo->ClearCounters(); diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index 5d92c785d..35ac457cc 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -1071,7 +1071,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm) newz = self->Sector->ceilingplane.ZatPoint(mo); int moceiling = P_Find3DFloor(NULL, pos.x, pos.y, newz, false, false, newz); if (moceiling >= 0) - mo->_f_SetZ(newz - mo->height, false); + mo->_f_SetZ(newz - mo->_f_height(), false); mo->Translation = multiplayer ? TRANSLATION(TRANSLATION_RainPillar,self->special2) : 0; mo->target = self->target; diff --git a/src/g_hexen/a_blastradius.cpp b/src/g_hexen/a_blastradius.cpp index e904bc022..d1df409f9 100644 --- a/src/g_hexen/a_blastradius.cpp +++ b/src/g_hexen/a_blastradius.cpp @@ -43,7 +43,7 @@ void BlastActor (AActor *victim, fixed_t strength, double speed, AActor *Owner, pos = victim->Vec3Offset( fixed_t((victim->_f_radius() + FRACUNIT) * angle.Cos()), fixed_t((victim->_f_radius() + FRACUNIT) * angle.Sin()), - -victim->floorclip + (victim->height>>1)); + -victim->floorclip + (victim->_f_height()>>1)); mo = Spawn (blasteffect, pos, ALLOW_REPLACE); if (mo) { diff --git a/src/g_hexen/a_clericholy.cpp b/src/g_hexen/a_clericholy.cpp index 5d972dbfc..7e61721cd 100644 --- a/src/g_hexen/a_clericholy.cpp +++ b/src/g_hexen/a_clericholy.cpp @@ -423,7 +423,7 @@ static void CHolySeekerMissile (AActor *actor, DAngle thresh, DAngle turnMax) || actor->Z() > target->Top() || actor->Top() < target->Z()) { - newZ = target->_f_Z()+((pr_holyseeker()*target->height)>>8); + newZ = target->_f_Z()+((pr_holyseeker()*target->_f_height())>>8); deltaZ = newZ - actor->_f_Z(); if (abs(deltaZ) > 15*FRACUNIT) { diff --git a/src/g_hexen/a_heresiarch.cpp b/src/g_hexen/a_heresiarch.cpp index 23bd3aa59..43122a85b 100644 --- a/src/g_hexen/a_heresiarch.cpp +++ b/src/g_hexen/a_heresiarch.cpp @@ -242,7 +242,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcSpinBalls) self->args[4] = SORCBALL_INITIAL_SPEED; // Initial orbit speed self->special1 = ANGLE_1; - fixedvec3 pos = self->PosPlusZ(-self->floorclip + self->height); + fixedvec3 pos = self->PosPlusZ(-self->floorclip + self->_f_height()); mo = Spawn("SorcBall1", pos, NO_REPLACE); if (mo) @@ -378,7 +378,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit) fixedvec3 pos = parent->Vec3Offset( FixedMul(dist, finecosine[angle]), FixedMul(dist, finesine[angle]), - -parent->floorclip + parent->height); + -parent->floorclip + parent->_f_height()); actor->SetOrigin (pos, true); actor->floorz = parent->floorz; actor->ceilingz = parent->ceilingz; @@ -714,7 +714,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnFizzle) AActor *mo; int ix; - fixedvec3 pos = self->_f_Vec3Angle(dist, self->_f_angle(), -self->floorclip + (self->height >> 1)); + fixedvec3 pos = self->_f_Vec3Angle(dist, self->_f_angle(), -self->floorclip + (self->_f_height() >> 1)); for (ix=0; ix<5; ix++) { mo = Spawn("SorcSpark1", pos, ALLOW_REPLACE); diff --git a/src/g_hexen/a_hexenspecialdecs.cpp b/src/g_hexen/a_hexenspecialdecs.cpp index a14d8ff9d..b3d1348ed 100644 --- a/src/g_hexen/a_hexenspecialdecs.cpp +++ b/src/g_hexen/a_hexenspecialdecs.cpp @@ -156,7 +156,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseBloodDrip) if (pr_drip() <= 128) { - Spawn ("CorpseBloodDrip", self->PosPlusZ(self->height/2), ALLOW_REPLACE); + Spawn ("CorpseBloodDrip", self->PosPlusZ(self->_f_height()/2), ALLOW_REPLACE); } return 0; } @@ -310,7 +310,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SoAExplode) { fixed_t xo = ((pr_soaexplode() - 128) << 12); fixed_t yo = ((pr_soaexplode() - 128) << 12); - fixed_t zo = (pr_soaexplode()*self->height / 256); + fixed_t zo = (pr_soaexplode()*self->_f_height() / 256); mo = Spawn ("ZArmorChunk", self->Vec3Offset(xo, yo, zo), ALLOW_REPLACE); if (mo) { @@ -365,7 +365,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BellReset1) PARAM_ACTION_PROLOGUE; self->flags |= MF_NOGRAVITY; - self->height <<= 2; + self->Height *= 4; if (self->special) { // Initiate death action P_ExecuteSpecial(self->special, NULL, NULL, false, self->args[0], diff --git a/src/g_hexen/a_iceguy.cpp b/src/g_hexen/a_iceguy.cpp index d50f1f974..fd7efe426 100644 --- a/src/g_hexen/a_iceguy.cpp +++ b/src/g_hexen/a_iceguy.cpp @@ -109,7 +109,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie) PARAM_ACTION_PROLOGUE; self->Vel.Zero(); - self->height = self->GetDefault()->height; + self->Height = self->GetDefault()->Height; CALL_ACTION(A_FreezeDeathChunks, self); return 0; } diff --git a/src/g_hexen/a_korax.cpp b/src/g_hexen/a_korax.cpp index 0bdd21571..f3693ae6b 100644 --- a/src/g_hexen/a_korax.cpp +++ b/src/g_hexen/a_korax.cpp @@ -388,10 +388,10 @@ static void A_KSpiritSeeker (AActor *actor, DAngle thresh, DAngle turnMax) actor->VelFromAngle(); if (!(level.time&15) - || actor->_f_Z() > target->_f_Z()+(target->GetDefault()->height) + || actor->_f_Z() > target->_f_Z()+(target->GetDefault()->_f_height()) || actor->_f_Top() < target->_f_Z()) { - newZ = target->_f_Z()+((pr_kspiritseek()*target->GetDefault()->height)>>8); + newZ = target->_f_Z()+((pr_kspiritseek()*target->GetDefault()->_f_height())>>8); deltaZ = newZ-actor->_f_Z(); if (abs(deltaZ) > 15*FRACUNIT) { diff --git a/src/g_hexen/a_magelightning.cpp b/src/g_hexen/a_magelightning.cpp index 55d3a25f2..f3f2e439d 100644 --- a/src/g_hexen/a_magelightning.cpp +++ b/src/g_hexen/a_magelightning.cpp @@ -161,7 +161,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip) } else if (self->flags3 & MF3_CEILINGHUGGER) { - self->SetZ(self->ceilingz - self->_Height()); + self->SetZ(self->ceilingz - self->Height); target = self->tracer; } if (self->flags3 & MF3_FLOORHUGGER) diff --git a/src/g_hexen/a_spike.cpp b/src/g_hexen/a_spike.cpp index 9bf3409a6..d7e9054c9 100644 --- a/src/g_hexen/a_spike.cpp +++ b/src/g_hexen/a_spike.cpp @@ -95,7 +95,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustInitDn) self->special2 = 5; // Raise speed self->args[0] = 0; // Mark as down - self->floorclip = self->GetDefault()->height; + self->floorclip = self->GetDefault()->_f_height(); self->flags = 0; self->flags2 = MF2_NOTELEPORT|MF2_FLOORCLIP; self->renderflags = RF_INVISIBLE; @@ -121,7 +121,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustRaise) } // Lose the dirt clump - if ((actor->floorclip < actor->height) && actor->DirtClump) + if ((actor->floorclip < actor->_f_height()) && actor->DirtClump) { actor->DirtClump->Destroy (); actor->DirtClump = NULL; diff --git a/src/g_hexen/a_wraith.cpp b/src/g_hexen/a_wraith.cpp index 0fada85c3..cf34e4a02 100644 --- a/src/g_hexen/a_wraith.cpp +++ b/src/g_hexen/a_wraith.cpp @@ -36,7 +36,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithInit) // [RH] Make sure the wraith didn't go into the ceiling if (self->Top() > self->ceilingz) { - self->SetZ(self->ceilingz - self->_Height()); + self->SetZ(self->ceilingz - self->Height); } self->special1 = 0; // index into floatbob @@ -57,7 +57,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithRaiseInit) self->flags2 &= ~MF2_NONSHOOTABLE; self->flags3 &= ~MF3_DONTBLAST; self->flags |= MF_SHOOTABLE|MF_SOLID; - self->floorclip = self->height; + self->floorclip = self->_f_height(); return 0; } diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index 70f5865f2..2b7db1e0b 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -189,7 +189,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeath) self->flags |= MF_SOLID|MF_SHOOTABLE|MF_NOBLOOD|MF_ICECORPSE; self->flags2 |= MF2_PUSHABLE|MF2_TELESTOMP|MF2_PASSMOBJ|MF2_SLIDE; self->flags3 |= MF3_CRASHED; - self->height = self->GetDefault()->height; + self->Height = self->GetDefault()->Height; // Remove fuzz effects from frozen actors. if (self->RenderStyle.BlendOp >= STYLEOP_Fuzz && self->RenderStyle.BlendOp <= STYLEOP_FuzzOrRevSub) { @@ -287,20 +287,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks) // base the number of shards on the size of the dead thing, so bigger // things break up into more shards than smaller things. // An actor with _f_radius() 20 and height 64 creates ~40 chunks. - numChunks = MAX (4, (self->_f_radius()>>FRACBITS)*(self->height>>FRACBITS)/32); + numChunks = MAX (4, (self->_f_radius()>>FRACBITS)*(self->_f_height()>>FRACBITS)/32); i = (pr_freeze.Random2()) % (numChunks/4); for (i = MAX (24, numChunks + i); i >= 0; i--) { fixed_t xo = (((pr_freeze() - 128)*self->_f_radius()) >> 7); fixed_t yo = (((pr_freeze() - 128)*self->_f_radius()) >> 7); - fixed_t zo = (pr_freeze()*self->height / 255); + fixed_t zo = (pr_freeze()*self->_f_height() / 255); mo = Spawn("IceChunk", self->Vec3Offset(xo, yo, zo), ALLOW_REPLACE); if (mo) { mo->SetState (mo->SpawnState + (pr_freeze()%3)); mo->Vel.X = pr_freeze.Random2() / 128.; mo->Vel.Y = pr_freeze.Random2() / 128.; - mo->Vel.Z = (mo->Z() - self->Z()) / self->_Height() * 4; + mo->Vel.Z = (mo->Z() - self->Z()) / self->Height * 4; CALL_ACTION(A_IceSetTics, mo); // set a random tic wait mo->RenderStyle = self->RenderStyle; mo->alpha = self->alpha; @@ -313,7 +313,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks) { head->Vel.X = pr_freeze.Random2() / 128.; head->Vel.Y = pr_freeze.Random2() / 128.; - head->Vel.Z = (mo->Z() - self->Z()) / self->_Height() * 4; + head->Vel.Z = (mo->Z() - self->Z()) / self->Height * 4; head->health = self->health; head->Angles.Yaw = self->Angles.Yaw; diff --git a/src/g_shared/a_bridge.cpp b/src/g_shared/a_bridge.cpp index 90355ec45..e874bc58e 100644 --- a/src/g_shared/a_bridge.cpp +++ b/src/g_shared/a_bridge.cpp @@ -49,12 +49,12 @@ void ACustomBridge::BeginPlay () { SetState(SeeState); radius = args[0] ? args[0] : 32; - height = args[1] ? args[1] << FRACBITS : 2 * FRACUNIT; + Height = args[1] ? args[1] : 2; } else // No balls? Then a Doom bridge. { radius = args[0] ? args[0] : 36; - height = args[1] ? args[1] << FRACBITS : 4 * FRACUNIT; + Height = args[1] ? args[1] : 4; RenderStyle = STYLE_Normal; } } @@ -164,6 +164,6 @@ void AInvisibleBridge::BeginPlay () if (args[0]) radius = args[0]; if (args[1]) - height = args[1] << FRACBITS; + Height = args[1]; } diff --git a/src/g_shared/a_camera.cpp b/src/g_shared/a_camera.cpp index 0808d0b9a..5c2e24444 100644 --- a/src/g_shared/a_camera.cpp +++ b/src/g_shared/a_camera.cpp @@ -175,7 +175,7 @@ void AAimingCamera::Tick () { // Aim camera's pitch; use floats for precision fixedvec2 fv3 = tracer->_f_Vec2To(this); DVector2 vect(fv3.x, fv3.y); - double dz = _f_Z() - tracer->_f_Z() - tracer->height/2; + double dz = _f_Z() - tracer->_f_Z() - tracer->_f_height()/2; double dist = vect.Length(); DAngle desiredPitch = dist != 0.f ? VecToAngle(dist, dz) : 0.; DAngle diff = deltaangle(Angles.Pitch, desiredPitch); diff --git a/src/g_shared/a_fastprojectile.cpp b/src/g_shared/a_fastprojectile.cpp index 2c050085e..e71f809aa 100644 --- a/src/g_shared/a_fastprojectile.cpp +++ b/src/g_shared/a_fastprojectile.cpp @@ -126,7 +126,7 @@ void AFastProjectile::Tick () return; } - SetZ(ceilingz - _Height()); + SetZ(ceilingz - Height); P_ExplodeMissile (this, NULL, NULL); return; } diff --git a/src/g_shared/a_movingcamera.cpp b/src/g_shared/a_movingcamera.cpp index d7284fec5..73c49167a 100644 --- a/src/g_shared/a_movingcamera.cpp +++ b/src/g_shared/a_movingcamera.cpp @@ -639,7 +639,7 @@ bool AMovingCamera::Interpolate () { // Also aim camera's pitch; use floats for precision double dx = FIXED2DBL(_f_X() - tracer->_f_X()); double dy = FIXED2DBL(_f_Y() - tracer->_f_Y()); - double dz = FIXED2DBL(_f_Z() - tracer->_f_Z() - tracer->height/2); + double dz = FIXED2DBL(_f_Z() - tracer->_f_Z() - tracer->_f_height()/2); double dist = g_sqrt (dx*dx + dy*dy); Angles.Pitch = dist != 0.f ? VecToAngle(dist, dz) : 0.; } diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index c62fb4ce9..2aea9fa14 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -426,11 +426,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition) if (self->flags & MF_SPAWNCEILING) { - self->_f_SetZ(self->_f_ceilingz() - self->height - self->SpawnPoint[2]); + self->_f_SetZ(self->_f_ceilingz() - self->_f_height() - self->SpawnPoint[2]); } else if (self->flags2 & MF2_SPAWNFLOAT) { - double space = self->ceilingz - self->_Height() - self->floorz; + double space = self->ceilingz - self->Height - self->floorz; if (space > 48) { space -= 40; @@ -454,7 +454,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition) } if ((self->flags & MF_SOLID) && (self->Top() > self->ceilingz)) { // Do the same for the ceiling. - self->SetZ(self->ceilingz - self->_Height()); + self->SetZ(self->ceilingz - self->Height); } // Do not interpolate from the position the actor was at when it was // picked up, in case that is different from where it is now. diff --git a/src/g_shared/a_randomspawner.cpp b/src/g_shared/a_randomspawner.cpp index 1e4180396..241cb1b14 100644 --- a/src/g_shared/a_randomspawner.cpp +++ b/src/g_shared/a_randomspawner.cpp @@ -188,11 +188,11 @@ class ARandomSpawner : public AActor // Handle special altitude flags if (newmobj->flags & MF_SPAWNCEILING) { - newmobj->_f_SetZ(newmobj->_f_ceilingz() - newmobj->height - SpawnPoint[2]); + newmobj->_f_SetZ(newmobj->_f_ceilingz() - newmobj->_f_height() - SpawnPoint[2]); } else if (newmobj->flags2 & MF2_SPAWNFLOAT) { - double space = newmobj->ceilingz - newmobj->_Height() - newmobj->floorz; + double space = newmobj->ceilingz - newmobj->Height - newmobj->floorz; if (space > 48) { space -= 40; diff --git a/src/g_strife/a_sentinel.cpp b/src/g_strife/a_sentinel.cpp index 841a18371..eb282fcce 100644 --- a/src/g_strife/a_sentinel.cpp +++ b/src/g_strife/a_sentinel.cpp @@ -23,7 +23,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelBob) if (self->threshold != 0) return 0; - maxz = self->ceilingz - self->_Height() - 16; + maxz = self->ceilingz - self->Height - 16; minz = self->floorz + 96; if (minz > maxz) { diff --git a/src/g_strife/a_spectral.cpp b/src/g_strife/a_spectral.cpp index 0901726b9..9e06433a1 100644 --- a/src/g_strife/a_spectral.cpp +++ b/src/g_strife/a_spectral.cpp @@ -129,13 +129,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2) { dist = 1; } - if (dest->height >= 56*FRACUNIT) + if (dest->_f_height() >= 56*FRACUNIT) { slope = (dest->_f_Z()+40*FRACUNIT - self->_f_Z()) / dist; } else { - slope = (dest->_f_Z() + self->height*2/3 - self->_f_Z()) / dist; + slope = (dest->_f_Z() + self->_f_height()*2/3 - self->_f_Z()) / dist; } if (slope < self->_f_velz()) { diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index 3b0c71229..5ee3393f8 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -554,7 +554,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave) savedz = self->_f_Z(); if (wavedef && self->ceilingz < wavedef->Top()) { - self->SetZ(self->ceilingz - wavedef->_Height()); + self->SetZ(self->ceilingz - wavedef->Height); } for (int i = 0; i < 80; ++i) diff --git a/src/info.cpp b/src/info.cpp index eec1cd415..09e8a576b 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -231,7 +231,7 @@ PClassActor::PClassActor() PoisonDamage = 0; FastSpeed = -1.; RDFactor = FRACUNIT; - CameraHeight = FIXED_MIN; + CameraHeight = INT_MIN; DropItems = NULL; diff --git a/src/info.h b/src/info.h index ecab45d3a..4fb150155 100644 --- a/src/info.h +++ b/src/info.h @@ -242,15 +242,15 @@ public: FString Obituary; // Player was killed by this actor FString HitObituary; // Player was killed by this actor in melee - fixed_t DeathHeight; // Height on normal death - fixed_t BurnHeight; // Height on burning death + double DeathHeight; // Height on normal death + double BurnHeight; // Height on burning death PalEntry BloodColor; // Colorized blood int GibHealth; // Negative health below which this monster dies an extreme death int WoundHealth; // Health needed to enter wound state int PoisonDamage; // Amount of poison damage double FastSpeed; // speed in fast mode fixed_t RDFactor; // Radius damage factor - fixed_t CameraHeight; // Height of camera when used as such + double CameraHeight; // Height of camera when used as such FSoundID HowlSound; // Sound being played when electrocuted or poisoned FName BloodType; // Blood replacement type FName BloodType2; // Bloopsplatter replacement type diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index fbfb95a50..595b19e82 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -333,7 +333,7 @@ void cht_DoCheat (player_t *player, int cheat) player->mo->flags6 = player->mo->GetDefault()->flags6; player->mo->flags7 = player->mo->GetDefault()->flags7; player->mo->renderflags &= ~RF_INVISIBLE; - player->mo->height = player->mo->GetDefault()->height; + player->mo->Height = player->mo->GetDefault()->Height; player->mo->radius = player->mo->GetDefault()->radius; player->mo->special1 = 0; // required for the Hexen fighter's fist attack. // This gets set by AActor::Die as flag for the wimpy death and must be reset here. diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index d73ad9fc5..b89bbd6a8 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -760,7 +760,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li fixed_t thingbot, thingtop; thingbot = thing->_f_Z(); - thingtop = thingbot + (thing->height==0? 1:thing->height); + thingtop = thingbot + (thing->_f_height()==0? 1:thing->_f_height()); extsector_t::xfloor *xf[2] = {&linedef->frontsector->e->XFloor, &linedef->backsector->e->XFloor}; diff --git a/src/p_3dmidtex.cpp b/src/p_3dmidtex.cpp index b49880a17..eeef7e7fe 100644 --- a/src/p_3dmidtex.cpp +++ b/src/p_3dmidtex.cpp @@ -278,7 +278,7 @@ bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, FLineOpening & open.abovemidtex = false; if (P_GetMidTexturePosition(linedef, 0, &tt, &tb)) { - if (thing->_f_Z() + (thing->height/2) < (tt + tb)/2) + if (thing->_f_Z() + (thing->_f_height()/2) < (tt + tb)/2) { if (tb < open.top) { diff --git a/src/p_acs.cpp b/src/p_acs.cpp index f38516374..6b4ac1e01 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -4087,7 +4087,7 @@ int DLevelScript::GetActorProperty (int tid, int property) case APROP_Mass: return actor->Mass; case APROP_Accuracy: return actor->accuracy; case APROP_Stamina: return actor->stamina; - case APROP_Height: return actor->height; + case APROP_Height: return actor->_f_height(); case APROP_Radius: return actor->_f_radius(); case APROP_ReactionTime:return actor->reactiontime; case APROP_MeleeRange: return actor->meleerange; @@ -4769,7 +4769,7 @@ static bool DoSpawnDecal(AActor *actor, const FDecalTemplate *tpl, int flags, an angle += actor->_f_angle(); } return NULL != ShootDecal(tpl, actor, actor->Sector, actor->_f_X(), actor->_f_Y(), - actor->_f_Z() + (actor->height>>1) - actor->floorclip + actor->GetBobOffset() + zofs, + actor->_f_Z() + (actor->_f_height()>>1) - actor->floorclip + actor->GetBobOffset() + zofs, angle, distance, !!(flags & SDF_PERMANENT)); } @@ -4998,7 +4998,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args) } else { - return actor->GetCameraHeight(); + return DoubleToACS(actor->GetCameraHeight()); } } else return 0; diff --git a/src/p_effect.cpp b/src/p_effect.cpp index 885f04af9..83568420f 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -410,7 +410,7 @@ static void MakeFountain (AActor *actor, int color1, int color2) angle_t an = M_Random()<<(24-ANGLETOFINESHIFT); fixed_t out = FixedMul (actor->_f_radius(), M_Random()<<8); - fixedvec3 pos = actor->Vec3Offset(FixedMul(out, finecosine[an]), FixedMul(out, finesine[an]), actor->height + FRACUNIT); + fixedvec3 pos = actor->Vec3Offset(FixedMul(out, finecosine[an]), FixedMul(out, finesine[an]), actor->_f_height() + FRACUNIT); particle->x = pos.x; particle->y = pos.y; particle->z = pos.z; @@ -439,9 +439,9 @@ void P_RunEffect (AActor *actor, int effects) if ((effects & FX_ROCKET) && (cl_rockettrails & 1)) { // Rocket trail - double backx = -actor->_Radius() * 2 * moveangle.Cos(); - double backy = -actor->_Radius() * 2 * moveangle.Sin(); - double backz = actor->_Height() * ((2. / 3) - actor->Vel.Z / 8); + double backx = -actor->radius * 2 * moveangle.Cos(); + double backy = -actor->radius * 2 * moveangle.Sin(); + double backz = actor->Height * ((2. / 3) - actor->Vel.Z / 8); DAngle an = moveangle + 90.; int speed; @@ -494,7 +494,7 @@ void P_RunEffect (AActor *actor, int effects) // Grenade trail fixedvec3 pos = actor->_f_Vec3Angle(-actor->_f_radius() * 2, moveangle.BAMs(), - fixed_t(-(actor->height >> 3) * (actor->Vel.Z) + (2 * actor->height) / 3)); + fixed_t(-(actor->_f_height() >> 3) * (actor->Vel.Z) + (2 * actor->_f_height()) / 3)); P_DrawSplash2 (6, pos.x, pos.y, pos.z, moveangle.BAMs() + ANG180, 2, 2); @@ -538,7 +538,7 @@ void P_RunEffect (AActor *actor, int effects) particle->size = 1; if (M_Random () < 128) { // make particle fall from top of actor - particle->z += actor->height; + particle->z += actor->_f_height(); particle->vel.z = -particle->vel.z; particle->accz = -particle->accz; } @@ -889,7 +889,7 @@ void P_DisconnectEffect (AActor *actor) fixed_t xo = ((M_Random() - 128) << 9) * (actor->_f_radius() >> FRACBITS); fixed_t yo = ((M_Random() - 128) << 9) * (actor->_f_radius() >> FRACBITS); - fixed_t zo = (M_Random() << 8) * (actor->height >> FRACBITS); + fixed_t zo = (M_Random() << 8) * (actor->_f_height() >> FRACBITS); fixedvec3 pos = actor->Vec3Offset(xo, yo, zo); p->x = pos.x; p->y = pos.y; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index eaaae7b22..90b130e39 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2642,7 +2642,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) != P_Find3DFloor(testsec, self->_f_Pos(), false, true, zdist2)) { // Not on same floor - if (vilesec == corpsec || abs(zdist1 - self->_f_Z()) > self->height) + if (vilesec == corpsec || abs(zdist1 - self->_f_Z()) > self->_f_height()) continue; } } @@ -2651,16 +2651,16 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) corpsehit->Vel.X = corpsehit->Vel.Y = 0; // [RH] Check against real height and _f_radius() - fixed_t oldheight = corpsehit->height; + double oldheight = corpsehit->Height; double oldradius = corpsehit->radius; ActorFlags oldflags = corpsehit->flags; corpsehit->flags |= MF_SOLID; - corpsehit->height = corpsehit->GetDefault()->height; + corpsehit->Height = corpsehit->GetDefault()->Height; bool check = P_CheckPosition(corpsehit, corpsehit->Pos()); corpsehit->flags = oldflags; corpsehit->radius = oldradius; - corpsehit->height = oldheight; + corpsehit->Height = oldheight; if (!check) continue; // got one! @@ -2702,10 +2702,10 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) } if (ib_compatflags & BCOMPATF_VILEGHOSTS) { - corpsehit->height <<= 2; + corpsehit->Height *= 4; // [GZ] This was a commented-out feature, so let's make use of it, // but only for ghost monsters so that they are visibly different. - if (corpsehit->height == 0) + if (corpsehit->Height == 0) { // Make raised corpses look ghostly if (corpsehit->alpha > TRANSLUC50) @@ -2721,7 +2721,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) } else { - corpsehit->height = info->height; // [RH] Use real mobj height + corpsehit->Height = info->Height; // [RH] Use real mobj height corpsehit->radius = info->radius; // [RH] Use real radius } @@ -2872,7 +2872,7 @@ void A_Face (AActor *self, AActor *other, angle_t _max_turn, angle_t _max_pitch, // its body. if (target_z >= other->_f_Top()) { - target_z = other->_f_Z() + (other->height / 2); + target_z = other->_f_Z() + (other->_f_height() / 2); } //Note there is no +32*FRACUNIT on purpose. This is for customization sake. @@ -2880,9 +2880,9 @@ void A_Face (AActor *self, AActor *other, angle_t _max_turn, angle_t _max_pitch, if (flags & FAF_BOTTOM) target_z = other->_f_Z() + other->GetBobOffset(); if (flags & FAF_MIDDLE) - target_z = other->_f_Z() + (other->height / 2) + other->GetBobOffset(); + target_z = other->_f_Z() + (other->_f_height() / 2) + other->GetBobOffset(); if (flags & FAF_TOP) - target_z = other->_f_Z() + (other->height) + other->GetBobOffset(); + target_z = other->_f_Z() + (other->_f_height()) + other->GetBobOffset(); target_z += z_add; @@ -3000,7 +3000,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail) // We probably won't hit the target, but aim at it anyway so we don't look stupid. fixedvec2 pos = self->_f_Vec2To(self->target); DVector2 xydiff(pos.x, pos.y); - double zdiff = (self->target->_f_Z() + (self->target->height>>1)) - (self->_f_Z() + (self->height>>1) - self->floorclip); + double zdiff = (self->target->_f_Z() + (self->target->_f_height()>>1)) - (self->_f_Z() + (self->_f_height()>>1) - self->floorclip); self->Angles.Pitch = -VecToAngle(xydiff.Length(), zdiff); } @@ -3178,7 +3178,7 @@ AInventory *P_DropItem (AActor *source, PClassActor *type, int dropamount, int c } else { - spawnz += source->height / 2; + spawnz += source->_f_height() / 2; } } mo = Spawn(type, source->_f_X(), source->_f_Y(), spawnz, ALLOW_REPLACE); @@ -3483,7 +3483,7 @@ int P_Massacre () bool A_SinkMobj (AActor *actor, fixed_t speed) { - if (actor->floorclip < actor->height) + if (actor->floorclip < actor->_f_height()) { actor->floorclip += speed; return false; diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index da6b36783..ba3d3af5d 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -89,7 +89,7 @@ void P_TouchSpecialThing (AActor *special, AActor *toucher) // The pickup is at or above the toucher's feet OR // The pickup is below the toucher. - if (delta > toucher->height || delta < MIN(-32*FRACUNIT, -special->height)) + if (delta > toucher->_f_height() || delta < MIN(-32*FRACUNIT, -special->_f_height())) { // out of reach return; } @@ -393,7 +393,7 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) flags6 |= MF6_KILLED; // [RH] Allow the death height to be overridden using metadata. - fixed_t metaheight = -1; + double metaheight = -1; if (DamageType == NAME_Fire) { metaheight = GetClass()->BurnHeight; @@ -404,11 +404,11 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) } if (metaheight < 0) { - height >>= 2; + Height *= 0.25; } else { - height = MAX (metaheight, 0); + Height = MAX (metaheight, 0); } // [RH] If the thing has a special, execute and remove it diff --git a/src/p_map.cpp b/src/p_map.cpp index 21c593799..18e2ccc87 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -291,7 +291,7 @@ void P_GetFloorCeilingZ(FCheckPosition &tmf, int flags) sector_t *sec = (!(flags & FFCF_SAMESECTOR) || tmf.thing->Sector == NULL)? P_PointInSector(tmf.x, tmf.y) : tmf.sector; F3DFloor *ffc, *fff; - tmf.ceilingz = FIXED2DBL(sec->NextHighestCeilingAt(tmf.x, tmf.y, tmf.z, tmf.z + tmf.thing->height, flags, &tmf.ceilingsector, &ffc)); + tmf.ceilingz = FIXED2DBL(sec->NextHighestCeilingAt(tmf.x, tmf.y, tmf.z, tmf.z + tmf.thing->_f_height(), flags, &tmf.ceilingsector, &ffc)); tmf.dropoffz = sec->NextLowestFloorAt(tmf.x, tmf.y, tmf.z, flags, tmf.thing->MaxStepHeight, &tmf.floorsector, &fff); tmf.floorz = FIXED2DBL(tmf.dropoffz); @@ -436,7 +436,7 @@ bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefra sector_t *sector = P_PointInSector(x, y); FPortalGroupArray grouplist; - FMultiBlockLinesIterator mit(grouplist, x, y, z, thing->height, thing->_f_radius(), sector); + FMultiBlockLinesIterator mit(grouplist, x, y, z, thing->_f_height(), thing->_f_radius(), sector); FMultiBlockLinesIterator::CheckResult cres; while (mit.Next(&cres)) @@ -447,7 +447,7 @@ bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefra if (tmf.touchmidtex) tmf.dropoffz = tmf._f_floorz(); - FMultiBlockThingsIterator mit2(grouplist, x, y, z, thing->height, thing->_f_radius(), false, sector); + FMultiBlockThingsIterator mit2(grouplist, x, y, z, thing->_f_height(), thing->_f_radius(), false, sector); FMultiBlockThingsIterator::CheckResult cres2; while (mit2.Next(&cres2)) @@ -479,7 +479,7 @@ bool P_TeleportMove(AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefra if (!(th->flags3 & thing->flags3 & MF3_DONTOVERLAP)) { if (z > th->_f_Top() || // overhead - z + thing->height < th->_f_Z()) // underneath + z + thing->_f_height() < th->_f_Z()) // underneath continue; } } @@ -1380,7 +1380,7 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch return true; } - int clipheight; + double clipheight; if (thing->projectilepassheight > 0) { @@ -1392,11 +1392,11 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch } else { - clipheight = thing->height; + clipheight = thing->Height; } // Check if it went over / under - if (tm.thing->_f_Z() > thing->_f_Z() + clipheight) + if (tm.thing->Z() > thing->Z() + clipheight) { // Over thing return true; } @@ -1605,7 +1605,7 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo { sector_t *newsec; AActor *thingblocker; - fixed_t realheight = thing->height; + double realHeight = thing->Height; tm.thing = thing; @@ -1645,14 +1645,14 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo thingblocker = NULL; if (thing->player) { // [RH] Fake taller height to catch stepping up into things. - thing->height = realheight + thing->MaxStepHeight; + thing->Height = realHeight + FIXED2DBL(thing->MaxStepHeight); } tm.stepthing = NULL; FBoundingBox box(x, y, thing->_f_radius()); FPortalGroupArray pcheck; - FMultiBlockThingsIterator it2(pcheck, x, y, thing->_f_Z(), thing->height, thing->_f_radius(), false, newsec); + FMultiBlockThingsIterator it2(pcheck, x, y, thing->_f_Z(), thing->_f_height(), thing->_f_radius(), false, newsec); FMultiBlockThingsIterator::CheckResult tcres; while ((it2.Next(&tcres))) @@ -1667,7 +1667,7 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo // If this blocks through a restricted line portal, it will always completely block. if (BlockingMobj == NULL || (i_compatflags & COMPATF_NO_PASSMOBJ) || (tcres.portalflags & FFCF_RESTRICTEDPORTAL)) { // Thing slammed into something; don't let it move now. - thing->height = realheight; + thing->Height = realHeight; return false; } else if (!BlockingMobj->player && !(thing->flags & (MF_FLOAT | MF_MISSILE | MF_SKULLFLY)) && @@ -1686,7 +1686,7 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo if (thingblocker) { // There is something to step up on. Return this thing as // the blocker so that we don't step up. - thing->height = realheight; + thing->Height = realHeight; return false; } // Nothing is blocking us, but this actor potentially could @@ -1695,7 +1695,7 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo } else { // Definitely blocking - thing->height = realheight; + thing->Height = realHeight; return false; } } @@ -1715,14 +1715,14 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo validcount++; thing->BlockingMobj = NULL; - thing->height = realheight; + thing->Height = realHeight; if (actorsonly || (thing->flags & MF_NOCLIP)) return (thing->BlockingMobj = thingblocker) == NULL; spechit.Clear(); portalhit.Clear(); - FMultiBlockLinesIterator it(pcheck, x, y, thing->_f_Z(), thing->height, thing->_f_radius(), newsec); + FMultiBlockLinesIterator it(pcheck, x, y, thing->_f_Z(), thing->_f_height(), thing->_f_radius(), newsec); FMultiBlockLinesIterator::CheckResult lcres; fixed_t thingdropoffz = tm._f_floorz(); @@ -1754,7 +1754,7 @@ bool P_CheckPosition(AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bo { return false; } - if (tm.ceilingz - tm.floorz < thing->_Height()) + if (tm.ceilingz - tm.floorz < thing->Height) { return false; } @@ -1925,7 +1925,7 @@ void P_FakeZMovement(AActor *mo) if (!(mo->flags & MF_SKULLFLY) && !(mo->flags & MF_INFLOAT)) { fixed_t dist = mo->AproxDistance(mo->target); - fixed_t delta = (mo->target->_f_Z() + (mo->height >> 1)) - mo->_f_Z(); + fixed_t delta = (mo->target->_f_Z() + (mo->_f_height() >> 1)) - mo->_f_Z(); if (delta < 0 && dist < -(delta * 3)) mo->_f_AddZ(-mo->_f_floatspeed()); else if (delta > 0 && dist < (delta * 3)) @@ -1947,7 +1947,7 @@ void P_FakeZMovement(AActor *mo) if (mo->Top() > mo->ceilingz) { // hit the ceiling - mo->SetZ(mo->ceilingz - mo->_Height()); + mo->SetZ(mo->ceilingz - mo->Height); } } @@ -2055,8 +2055,8 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y, goto pushline; } else if (BlockingMobj->_f_Top() - thing->_f_Z() > thing->MaxStepHeight - || (BlockingMobj->Sector->ceilingplane.ZatPoint(x, y) - (BlockingMobj->_f_Top()) < thing->height) - || (tm.ceilingz - (BlockingMobj->Top()) < thing->_Height())) + || (BlockingMobj->Sector->ceilingplane.ZatPoint(x, y) - (BlockingMobj->_f_Top()) < thing->_f_height()) + || (tm.ceilingz - (BlockingMobj->Top()) < thing->Height)) { goto pushline; } @@ -2075,7 +2075,7 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y, } else if (thing->flags3 & MF3_CEILINGHUGGER) { - thing->SetZ(tm.ceilingz - thing->_Height()); + thing->SetZ(tm.ceilingz - thing->Height); } if (onfloor && tm.floorsector == thing->floorsector) @@ -2084,7 +2084,7 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y, } if (!(thing->flags & MF_NOCLIP)) { - if (tm.ceilingz - tm.floorz < thing->_Height()) + if (tm.ceilingz - tm.floorz < thing->Height) { goto pushline; // doesn't fit } @@ -2238,7 +2238,7 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y, bool oldAboveFakeFloor, oldAboveFakeCeiling; fixed_t viewheight; - viewheight = thing->player ? thing->player->viewheight : thing->height / 2; + viewheight = thing->player ? thing->player->viewheight : thing->_f_height() / 2; oldAboveFakeFloor = oldAboveFakeCeiling = false; // pacify GCC if (oldsec->heightsec) @@ -2545,18 +2545,18 @@ bool P_CheckMove(AActor *thing, fixed_t x, fixed_t y) } else if (thing->flags3 & MF3_CEILINGHUGGER) { - newz = tm._f_ceilingz() - thing->height; + newz = tm._f_ceilingz() - thing->_f_height(); } if (!(thing->flags & MF_NOCLIP)) { - if (tm.ceilingz - tm.floorz < thing->_Height()) + if (tm.ceilingz - tm.floorz < thing->Height) { return false; } if (!(thing->flags & MF_TELEPORT) - && tm.ceilingz - newz < thing->_Height() + && tm.ceilingz - newz < thing->Height && !(thing->flags3 & MF3_CEILINGHUGGER) && (!(thing->flags2 & MF2_FLY) || !(thing->flags & MF_NOGRAVITY))) { @@ -2832,10 +2832,10 @@ void FSlide::SlideTraverse(fixed_t startx, fixed_t starty, fixed_t endx, fixed_t // set openrange, opentop, openbottom P_LineOpening(open, slidemo, li, it.InterceptPoint(in)); - if (open.range < slidemo->height) + if (open.range < slidemo->_f_height()) goto isblocking; // doesn't fit - if (open.top - slidemo->_f_Z() < slidemo->height) + if (open.top - slidemo->_f_Z() < slidemo->_f_height()) goto isblocking; // mobj is too high if (open.bottom - slidemo->_f_Z() > slidemo->MaxStepHeight) @@ -3187,10 +3187,10 @@ bool FSlide::BounceTraverse(fixed_t startx, fixed_t starty, fixed_t endx, fixed_ P_LineOpening(open, slidemo, li, it.InterceptPoint(in)); // set openrange, opentop, openbottom - if (open.range < slidemo->height) + if (open.range < slidemo->_f_height()) goto bounceblocking; // doesn't fit - if (open.top - slidemo->_f_Z() < slidemo->height) + if (open.top - slidemo->_f_Z() < slidemo->_f_height()) goto bounceblocking; // mobj is too high if (open.bottom > slidemo->_f_Z()) @@ -3749,7 +3749,7 @@ struct aim_t fixed_t bottomz = rover->bottom.plane->ZatPoint(startpos); - if (bottomz >= startpos.z + shootthing->height) + if (bottomz >= startpos.z + shootthing->_f_height()) { lastceilingplane = rover->bottom.plane; // no ceiling portal if below a 3D floor @@ -3916,7 +3916,7 @@ struct aim_t // check angles to see if the thing can be aimed at - thingtoppitch = -(int)R_PointToAngle2(0, shootz, dist, th->_f_Z() + th->height); + thingtoppitch = -(int)R_PointToAngle2(0, shootz, dist, th->_f_Z() + th->_f_height()); if (thingtoppitch > bottompitch) continue; // shot over the thing @@ -4027,7 +4027,7 @@ struct aim_t DAngle P_AimLineAttack(AActor *t1, DAngle angle, double distance, FTranslatedLineTarget *pLineTarget, DAngle vrange, int flags, AActor *target, AActor *friender) { - fixed_t shootz = t1->_f_Z() + (t1->height >> 1) - t1->floorclip; + fixed_t shootz = t1->_f_Z() + (t1->_f_height() >> 1) - t1->floorclip; if (t1->player != NULL) { shootz += fixed_t(t1->player->mo->AttackZOffset * t1->player->crouchfactor); @@ -4172,7 +4172,7 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance, vy = FLOAT2FIXED(pc * angle.Sin()); vz = FLOAT2FIXED(-pitch.Sin()); - shootz = t1->_f_Z() - t1->floorclip + (t1->height >> 1); + shootz = t1->_f_Z() - t1->floorclip + (t1->_f_height() >> 1); if (t1->player != NULL) { shootz += fixed_t(t1->player->mo->AttackZOffset * t1->player->crouchfactor); @@ -4434,7 +4434,7 @@ AActor *P_LinePickActor(AActor *t1, angle_t angle, fixed_t distance, int pitch, vy = FixedMul(finecosine[pitch], finesine[angle]); vz = -finesine[pitch]; - shootz = t1->_f_Z() - t1->floorclip + (t1->height >> 1); + shootz = t1->_f_Z() - t1->floorclip + (t1->_f_height() >> 1); if (t1->player != NULL) { shootz += fixed_t(t1->player->mo->AttackZOffset * t1->player->crouchfactor); @@ -4551,7 +4551,7 @@ void P_TraceBleed(int damage, fixed_t x, fixed_t y, fixed_t z, AActor *actor, an void P_TraceBleed(int damage, AActor *target, angle_t angle, int pitch) { - P_TraceBleed(damage, target->_f_X(), target->_f_Y(), target->_f_Z() + target->height / 2, + P_TraceBleed(damage, target->_f_X(), target->_f_Y(), target->_f_Z() + target->_f_height() / 2, target, angle, pitch); } @@ -4581,7 +4581,7 @@ void P_TraceBleed(int damage, AActor *target, AActor *missile) { pitch = 0; } - P_TraceBleed(damage, target->_f_X(), target->_f_Y(), target->_f_Z() + target->height / 2, + P_TraceBleed(damage, target->_f_X(), target->_f_Y(), target->_f_Z() + target->_f_height() / 2, target, missile->__f_AngleTo(target), pitch); } @@ -4600,7 +4600,7 @@ void P_TraceBleed(int damage, FTranslatedLineTarget *t, AActor *puff) } fixed_t randpitch = (pr_tracebleed() - 128) << 16; - P_TraceBleed(damage, t->linetarget->_f_X(), t->linetarget->_f_Y(), t->linetarget->_f_Z() + t->linetarget->height / 2, + P_TraceBleed(damage, t->linetarget->_f_X(), t->linetarget->_f_Y(), t->linetarget->_f_Z() + t->linetarget->_f_height() / 2, t->linetarget, FLOAT2ANGLE(t->angleFromSource.Degrees), 0); } @@ -4617,7 +4617,7 @@ void P_TraceBleed(int damage, AActor *target) fixed_t one = pr_tracebleed() << 24; fixed_t two = (pr_tracebleed() - 128) << 16; - P_TraceBleed(damage, target->_f_X(), target->_f_Y(), target->_f_Z() + target->height / 2, + P_TraceBleed(damage, target->_f_X(), target->_f_Y(), target->_f_Z() + target->_f_height() / 2, target, one, two); } } @@ -4705,7 +4705,7 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i vy = FixedMul(finecosine[pitch], finesine[angle]); vz = finesine[pitch]; - shootz = source->_f_Z() - source->floorclip + (source->height >> 1) + offset_z; + shootz = source->_f_Z() - source->floorclip + (source->_f_height() >> 1) + offset_z; if (!(railflags & RAF_CENTERZ)) { @@ -4874,7 +4874,7 @@ void P_AimCamera(AActor *t1, fixed_t &CameraX, fixed_t &CameraY, fixed_t &Camera vy = FixedMul(finecosine[pitch], finesine[angle]); vz = finesine[pitch]; - sz = t1->_f_Z() - t1->floorclip + t1->height + (fixed_t)(clamp(chase_height, -1000, 1000) * FRACUNIT); + sz = t1->_f_Z() - t1->floorclip + t1->_f_height() + (fixed_t)(clamp(chase_height, -1000, 1000) * FRACUNIT); if (Trace(t1->_f_X(), t1->_f_Y(), sz, t1->Sector, vx, vy, vz, distance, 0, 0, NULL, trace) && @@ -5107,7 +5107,7 @@ void P_UseLines(player_t *player) bool foundline = false; // If the player is transitioning a portal, use the group that is at its vertical center. - fixedvec2 start = player->mo->GetPortalTransition(player->mo->height / 2); + fixedvec2 start = player->mo->GetPortalTransition(player->mo->_f_height() / 2); // [NS] Now queries the Player's UseRange. fixedvec2 end = start + Vec2Angle(userange > 0? fixed_t(userange<mo->UseRange, player->mo->_f_angle()); @@ -5244,7 +5244,7 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo double bombdamagefloat = (double)bombdamage; FPortalGroupArray grouplist(FPortalGroupArray::PGA_Full3d); - FMultiBlockThingsIterator it(grouplist, bombspot->_f_X(), bombspot->_f_Y(), bombspot->_f_Z() - bombdistfix, bombspot->height + bombdistfix*2, bombdistfix, false, bombspot->Sector); + FMultiBlockThingsIterator it(grouplist, bombspot->_f_X(), bombspot->_f_Y(), bombspot->_f_Z() - bombdistfix, bombspot->_f_height() + bombdistfix*2, bombdistfix, false, bombspot->Sector); FMultiBlockThingsIterator::CheckResult cres; if (flags & RADF_SOURCEISSPOT) @@ -5637,7 +5637,7 @@ void P_DoCrunch(AActor *thing, FChangePosition *cpos) { AActor *mo; - mo = Spawn(bloodcls, thing->PosPlusZ(thing->height / 2), ALLOW_REPLACE); + mo = Spawn(bloodcls, thing->PosPlusZ(thing->_f_height() / 2), ALLOW_REPLACE); mo->Vel.X = pr_crunch.Random2() / 16.; mo->Vel.Y = pr_crunch.Random2() / 16.; @@ -5653,7 +5653,7 @@ void P_DoCrunch(AActor *thing, FChangePosition *cpos) an = (M_Random() - 128) << 24; if (cl_bloodtype >= 1) { - P_DrawSplash2(32, thing->_f_X(), thing->_f_Y(), thing->_f_Z() + thing->height / 2, an, 2, bloodcolor); + P_DrawSplash2(32, thing->_f_X(), thing->_f_Y(), thing->_f_Z() + thing->_f_height() / 2, an, 2, bloodcolor); } } if (thing->CrushPainSound != 0 && !S_GetSoundPlayingInfo(thing, thing->CrushPainSound)) @@ -5757,9 +5757,9 @@ int P_PushDown(AActor *thing, FChangePosition *cpos) } fixed_t oldz = intersect->_f_Z(); P_AdjustFloorCeil(intersect, cpos); - if (oldz > thing->_f_Z() - intersect->height) + if (oldz > thing->_f_Z() - intersect->_f_height()) { // Only push things down, not up. - intersect->_f_SetZ(thing->_f_Z() - intersect->height); + intersect->_f_SetZ(thing->_f_Z() - intersect->_f_height()); if (P_PushDown(intersect, cpos)) { // Move blocked P_DoCrunch(intersect, cpos); @@ -5895,9 +5895,9 @@ void PIT_CeilingLower(AActor *thing, FChangePosition *cpos) } intersectors.Clear(); fixed_t oldz = thing->_f_Z(); - if (thing->ceilingz - thing->_Height() >= thing->floorz) + if (thing->ceilingz - thing->Height >= thing->floorz) { - thing->SetZ(thing->ceilingz - thing->_Height()); + thing->SetZ(thing->ceilingz - thing->Height); } else { @@ -5948,7 +5948,7 @@ void PIT_CeilingRaise(AActor *thing, FChangePosition *cpos) thing->SetZ(thing->floorz); if (thing->Top() > thing->ceilingz) { - thing->SetZ(thing->ceilingz - thing->_Height()); + thing->SetZ(thing->ceilingz - thing->Height); } P_CheckFakeFloorTriggers(thing, oldz); } @@ -5957,7 +5957,7 @@ void PIT_CeilingRaise(AActor *thing, FChangePosition *cpos) AActor *onmobj; if (!P_TestMobjZ(thing, true, &onmobj) && onmobj->Z() <= thing->Z()) { - thing->SetZ(MIN(thing->ceilingz - thing->_Height(), onmobj->Top())); + thing->SetZ(MIN(thing->ceilingz - thing->Height, onmobj->Top())); } } if (thing->player && thing->player->mo == thing) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 02cfc690c..22d7c87fc 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -260,7 +260,7 @@ void AActor::Serialize(FArchive &arc) << floorsector << ceilingsector << radius - << height + << Height << projectilepassheight << Vel << tics @@ -1198,7 +1198,7 @@ bool AActor::Grind(bool items) { flags &= ~MF_SOLID; flags3 |= MF3_DONTGIB; - height = 0; + Height = 0; radius = 0; return false; } @@ -1225,7 +1225,7 @@ bool AActor::Grind(bool items) } flags &= ~MF_SOLID; flags3 |= MF3_DONTGIB; - height = 0; + Height = 0; radius = 0; SetState (state); if (isgeneric) // Not a custom crush state, so colorize it appropriately. @@ -1261,7 +1261,7 @@ bool AActor::Grind(bool items) // if there's no gib sprite don't crunch it. flags &= ~MF_SOLID; flags3 |= MF3_DONTGIB; - height = 0; + Height = 0; radius = 0; return false; } @@ -1271,7 +1271,7 @@ bool AActor::Grind(bool items) { gib->RenderStyle = RenderStyle; gib->alpha = alpha; - gib->height = 0; + gib->Height = 0; gib->radius = 0; PalEntry bloodcolor = GetBloodColor(); @@ -1742,12 +1742,12 @@ bool P_SeekerMissile (AActor *actor, angle_t _thresh, angle_t _turnMax, bool pre { // Need to seek vertically fixed_t dist = MAX(1, FLOAT2FIXED(actor->Distance2D(target))); // Aim at a player's eyes and at the middle of the actor for everything else. - fixed_t aimheight = target->height/2; + fixed_t aimheight = target->_f_height()/2; if (target->IsKindOf(RUNTIME_CLASS(APlayerPawn))) { aimheight = static_cast(target)->ViewHeight; } - pitch = ANGLE2DBL(R_PointToAngle2(0, actor->_f_Z() + actor->height/2, dist, target->_f_Z() + aimheight)); + pitch = ANGLE2DBL(R_PointToAngle2(0, actor->_f_Z() + actor->_f_height()/2, dist, target->_f_Z() + aimheight)); } actor->Vel3DFromAngle(pitch, speed); } @@ -2079,7 +2079,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) //dest->x - source->x DVector3 vect = mo->Vec3To(origin); - vect.Z += origin->_Height() / 2; + vect.Z += origin->Height / 2; mo->Vel = vect.Resized(mo->Speed); } else @@ -2439,7 +2439,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) if (!(mo->flags & (MF_SKULLFLY | MF_INFLOAT))) { dist = mo->AproxDistance (mo->target); - delta = (mo->target->_f_Z() + (mo->height>>1)) - mo->_f_Z(); + delta = (mo->target->_f_Z() + (mo->_f_height()>>1)) - mo->_f_Z(); if (delta < 0 && dist < -(delta*3)) mo->_f_AddZ(-mo->_f_floatspeed()); else if (delta > 0 && dist < (delta*3)) @@ -2465,7 +2465,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) if (!(rover->flags & FF_SWIMMABLE)) continue; if (mo->_f_Z() >= rover->top.plane->ZatPoint(mo) || - mo->_f_Z() + mo->height/2 < rover->bottom.plane->ZatPoint(mo)) + mo->_f_Z() + mo->_f_height()/2 < rover->bottom.plane->ZatPoint(mo)) continue; friction = rover->model->GetFriction(rover->top.isceiling); @@ -2593,7 +2593,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz) // teleported the actor so it is no longer above the ceiling. if (mo->Top() > mo->ceilingz) { - mo->SetZ(mo->ceilingz - mo->_Height()); + mo->SetZ(mo->ceilingz - mo->Height); if (mo->BounceFlags & BOUNCE_Ceilings) { // ceiling bounce mo->FloorBounceMissile (mo->ceilingsector->ceilingplane); @@ -2649,7 +2649,7 @@ void P_CheckFakeFloorTriggers (AActor *mo, fixed_t oldz, bool oldz_has_viewheigh } else { - viewheight = mo->height / 2; + viewheight = mo->_f_height() / 2; } if (oldz > waterz && mo->_f_Z() <= waterz) @@ -2769,7 +2769,7 @@ void P_NightmareRespawn (AActor *mobj) } if (mo->Top() > mo->ceilingz) { - mo->SetZ(mo->ceilingz- mo->_Height()); + mo->SetZ(mo->ceilingz- mo->Height); } } else if (z == ONCEILINGZ) @@ -2791,7 +2791,7 @@ void P_NightmareRespawn (AActor *mobj) } if (mo->Top() > mo->ceilingz) { // Do the same for the ceiling. - mo->SetZ(mo->ceilingz - mo->_Height()); + mo->SetZ(mo->ceilingz - mo->Height); } } @@ -3458,10 +3458,11 @@ void AActor::Tick () if (++smokecounter == 8) { smokecounter = 0; - angle_t moveangle = R_PointToAngle2(0,0,_f_velx(),_f_vely()); - fixed_t xo = -FixedMul(finecosine[(moveangle) >> ANGLETOFINESHIFT], _f_radius() * 2) + (pr_rockettrail() << 10); - fixed_t yo = -FixedMul(finesine[(moveangle) >> ANGLETOFINESHIFT], _f_radius() * 2) + (pr_rockettrail() << 10); - AActor * th = Spawn("GrenadeSmokeTrail", Vec3Offset(xo, yo, - (height>>3) * (_f_velz()>>16) + (2*height)/3), ALLOW_REPLACE); + DAngle moveangle = Vel.Angle(); + double xo = -moveangle.Cos() * radius * 2 + pr_rockettrail() / 64.; + double yo = -moveangle.Sin() * radius * 2 + pr_rockettrail() / 64.; + double zo = -Height * Vel.Z / 8. + Height * (2 / 3.); + AActor * th = Spawn("GrenadeSmokeTrail", Vec3Offset(xo, yo, zo), ALLOW_REPLACE); if (th) { th->tics -= pr_rockettrail()&3; @@ -3991,7 +3992,7 @@ void AActor::CheckSectorTransition(sector_t *oldsec) { act |= SECSPAC_HitFloor; } - if (_f_Z() + height >= Sector->ceilingplane.ZatPoint(this)) + if (_f_Z() + _f_height() >= Sector->ceilingplane.ZatPoint(this)) { act |= SECSPAC_HitCeiling; } @@ -4048,11 +4049,11 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash) if (_f_Z() < fh) { waterlevel = 1; - if (_f_Z() + height/2 < fh) + if (_f_Z() + _f_height()/2 < fh) { waterlevel = 2; if ((player && _f_Z() + player->viewheight <= fh) || - (_f_Z() + height <= fh)) + (_f_Z() + _f_height() <= fh)) { waterlevel = 3; } @@ -4087,17 +4088,17 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash) fixed_t ff_bottom=rover->bottom.plane->ZatPoint(this); fixed_t ff_top=rover->top.plane->ZatPoint(this); - if(ff_top <= _f_Z() || ff_bottom > (_f_Z() + (height >> 1))) continue; + if(ff_top <= _f_Z() || ff_bottom > (_f_Z() + (_f_height() >> 1))) continue; fh=ff_top; if (_f_Z() < fh) { waterlevel = 1; - if (_f_Z() + height/2 < fh) + if (_f_Z() + _f_height()/2 < fh) { waterlevel = 2; if ((player && _f_Z() + player->viewheight <= fh) || - (_f_Z() + height <= fh)) + (_f_Z() + _f_height() <= fh)) { waterlevel = 3; } @@ -4207,7 +4208,7 @@ AActor *AActor::StaticSpawn (PClassActor *type, fixed_t ix, fixed_t iy, fixed_t } else if (iz == ONCEILINGZ) { - actor->SetZ(actor->ceilingz - actor->_Height()); + actor->SetZ(actor->ceilingz - actor->Height); } if (SpawningMapThing || !type->IsDescendantOf (RUNTIME_CLASS(APlayerPawn))) @@ -4250,11 +4251,11 @@ AActor *AActor::StaticSpawn (PClassActor *type, fixed_t ix, fixed_t iy, fixed_t } else if (iz == ONCEILINGZ) { - actor->SetZ(actor->ceilingz - actor->_Height()); + actor->SetZ(actor->ceilingz - actor->Height); } else if (iz == FLOATRANDZ) { - double space = actor->ceilingz - actor->_Height() - actor->floorz; + double space = actor->ceilingz - actor->Height - actor->floorz; if (space > 48) { space -= 40; @@ -4788,7 +4789,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags) // drop down below it, even if that means sinking into the floor. if (mobj->Top() > mobj->ceilingz) { - mobj->SetZ(mobj->ceilingz - mobj->_Height(), false); + mobj->SetZ(mobj->ceilingz - mobj->Height, false); } // [BC] Do script stuff @@ -5556,7 +5557,7 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z // don't splash above the object if (checkabove) { - fixed_t compare_z = thing->_f_Z() + (thing->height >> 1); + fixed_t compare_z = thing->_f_Z() + (thing->_f_height() >> 1); // Missiles are typically small and fast, so they might // end up submerged by the move that calls P_HitWater. if (thing->flags & MF_MISSILE) @@ -5953,9 +5954,9 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, velocity.Z = 0; } // [RH] Adjust the trajectory if the missile will go over the target's head. - else if (FIXED2FLOAT(z) - source->Z() >= dest->_Height()) + else if (FIXED2FLOAT(z) - source->Z() >= dest->Height) { - velocity.Z += (dest->_Height() - FIXED2FLOAT(z) + source->Z()); + velocity.Z += (dest->Height - FIXED2FLOAT(z) + source->Z()); } th->Vel = velocity.Resized(speed); @@ -6195,7 +6196,7 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, if (z != ONFLOORZ && z != ONCEILINGZ) { // Doom spawns missiles 4 units lower than hitscan attacks for players. - z += source->_f_Z() + (source->height>>1) - source->floorclip; + z += source->_f_Z() + (source->_f_height()>>1) - source->floorclip; if (source->player != NULL) // Considering this is for player missiles, it better not be NULL. { z += fixed_t ((source->player->mo->AttackZOffset - 4*FRACUNIT) * source->player->crouchfactor); @@ -6545,9 +6546,9 @@ int AActor::GetGibHealth() const } } -fixed_t AActor::GetCameraHeight() const +double AActor::GetCameraHeight() const { - return GetClass()->CameraHeight == FIXED_MIN ? height / 2 : GetClass()->CameraHeight; + return GetClass()->CameraHeight == INT_MIN ? Height / 2 : GetClass()->CameraHeight; } DDropItem *AActor::GetDropItems() const diff --git a/src/p_sight.cpp b/src/p_sight.cpp index 27ee0db34..dfe510f85 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -114,7 +114,7 @@ public: { sightstart = t1->PosRelative(task->portalgroup); sightend = t2->PosRelative(task->portalgroup); - sightstart.z += t1->height - (t1->height >> 2); + sightstart.z += t1->_f_height() - (t1->_f_height() >> 2); startfrac = task->frac; trace = { sightstart.x, sightstart.y, sightend.x - sightstart.x, sightend.y - sightstart.y }; @@ -863,16 +863,16 @@ sightcounts[0]++; if (!(flags & SF_IGNOREWATERBOUNDARY)) { if ((s1->GetHeightSec() && - ((t1->_f_Z() + t1->height <= s1->heightsec->floorplane.ZatPoint(t1) && + ((t1->_f_Z() + t1->_f_height() <= s1->heightsec->floorplane.ZatPoint(t1) && t2->_f_Z() >= s1->heightsec->floorplane.ZatPoint(t2)) || (t1->_f_Z() >= s1->heightsec->ceilingplane.ZatPoint(t1) && - t2->_f_Z() + t1->height <= s1->heightsec->ceilingplane.ZatPoint(t2)))) + t2->_f_Z() + t1->_f_height() <= s1->heightsec->ceilingplane.ZatPoint(t2)))) || (s2->GetHeightSec() && - ((t2->_f_Z() + t2->height <= s2->heightsec->floorplane.ZatPoint(t2) && + ((t2->_f_Z() + t2->_f_height() <= s2->heightsec->floorplane.ZatPoint(t2) && t1->_f_Z() >= s2->heightsec->floorplane.ZatPoint(t1)) || (t2->_f_Z() >= s2->heightsec->ceilingplane.ZatPoint(t2) && - t1->_f_Z() + t2->height <= s2->heightsec->ceilingplane.ZatPoint(t1))))) + t1->_f_Z() + t2->_f_height() <= s2->heightsec->ceilingplane.ZatPoint(t1))))) { res = false; goto done; @@ -886,11 +886,11 @@ sightcounts[0]++; portals.Clear(); { sector_t *sec; - fixed_t lookheight = t1->height - (t1->height >> 2); + fixed_t lookheight = t1->_f_height() - (t1->_f_height() >> 2); t1->GetPortalTransition(lookheight, &sec); fixed_t bottomslope = t2->_f_Z() - (t1->_f_Z() + lookheight); - fixed_t topslope = bottomslope + t2->height; + fixed_t topslope = bottomslope + t2->_f_height(); SightTask task = { 0, topslope, bottomslope, -1, sec->PortalGroup }; diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 0e1765709..92c12c9a2 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -559,7 +559,7 @@ void P_SectorDamage(int tag, int amount, FName type, PClassActor *protectClass, z1 = z2; z2 = zz; } - if (actor->_f_Z() + actor->height > z1) + if (actor->_f_Z() + actor->_f_height() > z1) { // If DAMAGE_IN_AIR is used, anything not beneath the 3D floor will be // damaged (so, anything touching it or above it). Other 3D floors between diff --git a/src/p_teleport.cpp b/src/p_teleport.cpp index 05c16712a..61eb73dc7 100644 --- a/src/p_teleport.cpp +++ b/src/p_teleport.cpp @@ -135,9 +135,9 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, DAngle angle, i if (thing->flags & MF_NOGRAVITY && aboveFloor) { z = floorheight + aboveFloor; - if (z + thing->height > ceilingheight) + if (z + thing->_f_height() > ceilingheight) { - z = ceilingheight - thing->height; + z = ceilingheight - thing->_f_height(); } } else @@ -152,9 +152,9 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, DAngle angle, i else if (thing->flags & MF_MISSILE) { z = floorheight + aboveFloor; - if (z + thing->height > ceilingheight) + if (z + thing->_f_height() > ceilingheight) { - z = ceilingheight - thing->height; + z = ceilingheight - thing->_f_height(); } } else diff --git a/src/p_things.cpp b/src/p_things.cpp index 3150c2063..7df677875 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -258,7 +258,7 @@ bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_nam if (targ != NULL) { DVector3 aim = mobj->Vec3To(targ); - aim.Z += targ->_Height() / 2; + aim.Z += targ->Height / 2; if (leadTarget && speed > 0 && !targ->Vel.isZero()) { @@ -424,18 +424,18 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser) thing->Vel.X = thing->Vel.Y = 0; // [RH] Check against real height and radius - fixed_t oldheight = thing->height; + double oldheight = thing->Height; double oldradius = thing->radius; ActorFlags oldflags = thing->flags; thing->flags |= MF_SOLID; - thing->height = info->height; // [RH] Use real height + thing->Height = info->Height; // [RH] Use real height thing->radius = info->radius; // [RH] Use real radius if (!P_CheckPosition (thing, thing->_f_Pos())) { thing->flags = oldflags; thing->radius = oldradius; - thing->height = oldheight; + thing->Height = oldheight; return false; } @@ -466,11 +466,11 @@ bool P_Thing_CanRaise(AActor *thing) // Check against real height and radius ActorFlags oldflags = thing->flags; - fixed_t oldheight = thing->height; + double oldheight = thing->Height; double oldradius = thing->radius; thing->flags |= MF_SOLID; - thing->height = info->height; + thing->Height = info->Height; thing->radius = info->radius; bool check = P_CheckPosition (thing, thing->Pos()); @@ -478,7 +478,7 @@ bool P_Thing_CanRaise(AActor *thing) // Restore checked properties thing->flags = oldflags; thing->radius = oldradius; - thing->height = oldheight; + thing->Height = oldheight; if (!check) { @@ -686,7 +686,7 @@ int P_Thing_Warp(AActor *caller, AActor *reference, fixed_t xofs, fixed_t yofs, fixedvec3 old = caller->_f_Pos(); int oldpgroup = caller->Sector->PortalGroup; - zofs += FixedMul(reference->height, heightoffset); + zofs += FixedMul(reference->_f_height(), heightoffset); if (!(flags & WARPF_ABSOLUTEANGLE)) diff --git a/src/p_user.cpp b/src/p_user.cpp index c5bad9f2e..5ab2a1867 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -744,11 +744,11 @@ void APlayerPawn::Tick() { if (player != NULL && player->mo == this && player->CanCrouch() && player->playerstate != PST_DEAD) { - height = fixed_t(GetDefault()->height * player->crouchfactor); + Height = GetDefault()->Height * player->crouchfactor; } else { - if (health > 0) height = GetDefault()->height; + if (health > 0) Height = GetDefault()->Height; } Super::Tick(); } @@ -2241,8 +2241,8 @@ void P_DeathThink (player_t *player) void P_CrouchMove(player_t * player, int direction) { - fixed_t defaultheight = player->mo->GetDefault()->height; - fixed_t savedheight = player->mo->height; + double defaultheight = player->mo->GetDefault()->Height; + double savedheight = player->mo->Height; double crouchspeed = direction * CROUCHSPEED; fixed_t oldheight = player->viewheight; @@ -2250,10 +2250,10 @@ void P_CrouchMove(player_t * player, int direction) player->crouchfactor += crouchspeed; // check whether the move is ok - player->mo->height = fixed_t(defaultheight * player->crouchfactor); + player->mo->Height = defaultheight * player->crouchfactor; if (!P_TryMove(player->mo, player->mo->_f_X(), player->mo->_f_Y(), false, NULL)) { - player->mo->height = savedheight; + player->mo->Height = savedheight; if (direction > 0) { // doesn't fit @@ -2261,7 +2261,7 @@ void P_CrouchMove(player_t * player, int direction) return; } } - player->mo->height = savedheight; + player->mo->Height = savedheight; player->crouchfactor = clamp(player->crouchfactor, 0.5, 1.); player->viewheight = fixed_t(player->mo->ViewHeight * player->crouchfactor); diff --git a/src/r_draw.cpp b/src/r_draw.cpp index c16817691..7a7fe5a96 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -1072,7 +1072,7 @@ void R_DrawSpanP_C (void) #ifdef RANGECHECK if (ds_x2 < ds_x1 || ds_x1 < 0 - || ds_x2 >= screen->width || ds_y > screen->height) + || ds_x2 >= screen->width || ds_y > screen->_f_height()) { I_Error ("R_DrawSpan: %i to %i at %i", ds_x1, ds_x2, ds_y); } diff --git a/src/r_utility.cpp b/src/r_utility.cpp index 91053703c..b1c7d6cc1 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -985,7 +985,7 @@ void R_SetupFrame (AActor *actor) { iview->nviewx = camera->_f_X(); iview->nviewy = camera->_f_Y(); - iview->nviewz = camera->player ? camera->player->viewz : camera->_f_Z() + camera->GetCameraHeight(); + iview->nviewz = camera->player ? camera->player->viewz : FLOAT2FIXED(camera->Z() + camera->GetCameraHeight()); viewsector = camera->Sector; r_showviewer = false; } diff --git a/src/thingdef/olddecorations.cpp b/src/thingdef/olddecorations.cpp index ecac5d4be..0a0e93f6f 100644 --- a/src/thingdef/olddecorations.cpp +++ b/src/thingdef/olddecorations.cpp @@ -63,7 +63,7 @@ struct FExtraInfo bool bSolidOnDeath, bSolidOnBurn; bool bBurnAway, bDiesAway, bGenericIceDeath; bool bExplosive; - fixed_t DeathHeight, BurnHeight; + double DeathHeight, BurnHeight; }; class AFakeInventory : public AInventory @@ -256,7 +256,7 @@ void ParseOldDecoration(FScanner &sc, EDefinitionType def) if (extra.DeathHeight == 0) { - extra.DeathHeight = ((AActor*)(type->Defaults))->height; + extra.DeathHeight = ((AActor*)(type->Defaults))->Height; } type->DeathHeight = extra.DeathHeight; } @@ -296,7 +296,7 @@ void ParseOldDecoration(FScanner &sc, EDefinitionType def) type->OwnedStates[extra.FireDeathStart].SetAction("A_ActiveAndUnblock"); } - if (extra.BurnHeight == 0) extra.BurnHeight = ((AActor*)(type->Defaults))->height; + if (extra.BurnHeight == 0) extra.BurnHeight = ((AActor*)(type->Defaults))->Height; type->BurnHeight = extra.BurnHeight; bag.statedef.SetStateLabel("Burn", &type->OwnedStates[extra.FireDeathStart]); @@ -460,17 +460,17 @@ static void ParseInsideDecoration (Baggage &bag, AActor *defaults, else if (sc.Compare ("Height")) { sc.MustGetFloat (); - defaults->height = int(sc.Float * FRACUNIT); + defaults->Height = sc.Float; } else if (def == DEF_BreakableDecoration && sc.Compare ("DeathHeight")) { sc.MustGetFloat (); - extra.DeathHeight = int(sc.Float * FRACUNIT); + extra.DeathHeight = sc.Float; } else if (def == DEF_BreakableDecoration && sc.Compare ("BurnHeight")) { sc.MustGetFloat (); - extra.BurnHeight = int(sc.Float * FRACUNIT); + extra.BurnHeight = sc.Float; } else if (def == DEF_BreakableDecoration && sc.Compare ("Health")) { diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 6f43e7ca9..39061acff 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -315,7 +315,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetDistance) { fixedvec3 diff = self->_f_Vec3To(target); if (checkz) - diff.z += (target->height - self->height) / 2; + diff.z += (target->_f_height() - self->_f_height()) / 2; const double length = DVector3(FIXED2DBL(diff.x), FIXED2DBL(diff.y), (checkz) ? FIXED2DBL(diff.z) : 0).Length(); ret->SetFloat(length); @@ -1919,8 +1919,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun) // We probably won't hit the target, but aim at it anyway so we don't look stupid. fixedvec2 pos = self->_f_Vec2To(self->target); DVector2 xydiff(pos.x, pos.y); - double zdiff = (self->target->_f_Z() + (self->target->height>>1)) - - (self->_f_Z() + (self->height>>1) - self->floorclip); + double zdiff = (self->target->_f_Z() + (self->target->_f_height()>>1)) - + (self->_f_Z() + (self->_f_height()>>1) - self->floorclip); self->Angles.Pitch = VecToAngle(xydiff.Length(), zdiff); } // Let the aim trail behind the player @@ -2942,7 +2942,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnDebris) { fixed_t xo = ((pr_spawndebris() - 128) << 12); fixed_t yo = ((pr_spawndebris() - 128) << 12); - fixed_t zo = (pr_spawndebris()*self->height / 256 + self->GetBobOffset()); + fixed_t zo = (pr_spawndebris()*self->_f_height() / 256 + self->GetBobOffset()); mo = Spawn(debris, self->Vec3Offset(xo, yo, zo), ALLOW_REPLACE); if (mo) { @@ -3079,7 +3079,7 @@ static bool DoCheckSightOrRange(AActor *self, AActor *camera, double range, bool // Check distance first, since it's cheaper than checking sight. fixedvec2 pos = camera->_f_Vec2To(self); fixed_t dz; - fixed_t eyez = (camera->_f_Top() - (camera->height>>2)); // same eye height as P_CheckSight + fixed_t eyez = (camera->_f_Top() - (camera->_f_height()>>2)); // same eye height as P_CheckSight if (eyez > self->_f_Top()) { dz = self->_f_Top() - eyez; @@ -3149,7 +3149,7 @@ static bool DoCheckRange(AActor *self, AActor *camera, double range, bool twodi) // Check distance first, since it's cheaper than checking sight. fixedvec2 pos = camera->_f_Vec2To(self); fixed_t dz; - fixed_t eyez = (camera->_f_Top() - (camera->height>>2)); // same eye height as P_CheckSight + fixed_t eyez = (camera->_f_Top() - (camera->_f_height()>>2)); // same eye height as P_CheckSight if (eyez > self->_f_Top()) { dz = self->_f_Top() - eyez; @@ -3314,25 +3314,25 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst) } self->Vel.Zero(); - self->height = self->GetDefault()->height; + self->Height = self->GetDefault()->Height; // [RH] In Hexen, this creates a random number of shards (range [24,56]) // with no relation to the size of the self shattering. I think it should // base the number of shards on the size of the dead thing, so bigger // things break up into more shards than smaller things. // An self with _f_radius() 20 and height 64 creates ~40 chunks. - numChunks = MAX (4, (self->_f_radius()>>FRACBITS)*(self->height>>FRACBITS)/32); + numChunks = MAX (4, int(self->radius * self->Height)); i = (pr_burst.Random2()) % (numChunks/4); for (i = MAX (24, numChunks + i); i >= 0; i--) { fixed_t xo = (((pr_burst() - 128)*self->_f_radius()) >> 7); fixed_t yo = (((pr_burst() - 128)*self->_f_radius()) >> 7); - fixed_t zo = (pr_burst()*self->height / 255 + self->GetBobOffset()); + fixed_t zo = (pr_burst()*self->_f_height() / 255 + self->GetBobOffset()); mo = Spawn(chunk, self->Vec3Offset(xo, yo, zo), ALLOW_REPLACE); if (mo) { - mo->Vel.Z = 4 * (mo->Z() - self->Z()) * self->_Height(); + mo->Vel.Z = 4 * (mo->Z() - self->Z()) * self->Height; mo->Vel.X = pr_burst.Random2() / 128.; mo->Vel.Y = pr_burst.Random2() / 128.; mo->RenderStyle = self->RenderStyle; @@ -3442,7 +3442,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn) fixedvec3 pos = self->_f_Pos(); self->flags |= MF_SOLID; - self->height = self->GetDefault()->height; + self->Height = self->GetDefault()->Height; self->radius = self->GetDefault()->radius; CALL_ACTION(A_RestoreSpecialPosition, self); @@ -3716,12 +3716,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckLOF) { if (self->player != NULL) { - // Synced with hitscan: self->player->mo->height is strangely conscientious about getting the right actor for player - offsetheight = FixedMul(offsetheight, fixed_t(self->player->mo->height * self->player->crouchfactor)); + // Synced with hitscan: self->player->mo->_f_height() is strangely conscientious about getting the right actor for player + offsetheight = FixedMul(offsetheight, fixed_t(self->player->mo->_f_height() * self->player->crouchfactor)); } else { - offsetheight = FixedMul(offsetheight, self->height); + offsetheight = FixedMul(offsetheight, self->_f_height()); } } if (flags & CLOFF_MUL_WIDTH) @@ -3735,8 +3735,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckLOF) if (!(flags & CLOFF_FROMBASE)) { // default to hitscan origin - // Synced with hitscan: self->height is strangely NON-conscientious about getting the right actor for player - pos.z += (self->height >> 1); + // Synced with hitscan: self->_f_height() is strangely NON-conscientious about getting the right actor for player + pos.z += (self->_f_height() >> 1); if (self->player != NULL) { pos.z += fixed_t (self->player->mo->AttackZOffset * self->player->crouchfactor); @@ -3785,11 +3785,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckLOF) } else if (flags & CLOFF_AIM_VERT_NOOFFSET) { - pitch -= VecToAngle(xydist, FIXED2FLOAT(target->_f_Z() - pos.z + offsetheight + target->height / 2)); + pitch -= VecToAngle(xydist, FIXED2FLOAT(target->_f_Z() - pos.z + offsetheight + target->_f_height() / 2)); } else { - pitch -= VecToAngle(xydist, FIXED2FLOAT(target->_f_Z() - pos.z + target->height / 2)); + pitch -= VecToAngle(xydist, FIXED2FLOAT(target->_f_Z() - pos.z + target->_f_height() / 2)); } } else if (flags & CLOFF_ALLOWNULL) @@ -4783,7 +4783,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport) if (flags & TF_SENSITIVEZ) { double posz = (flags & TF_USESPOTZ) ? spot->Z() : spot->floorz; - if ((posz + ref->_Height() > spot->ceilingz) || (posz < spot->floorz)) + if ((posz + ref->Height > spot->ceilingz) || (posz < spot->floorz)) { return numret; } @@ -4793,7 +4793,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport) double finalz = spot->floorz + aboveFloor; if (spot->Top() > spot->ceilingz) - finalz = spot->ceilingz - ref->_Height(); + finalz = spot->ceilingz - ref->Height; else if (spot->Z() < spot->floorz) finalz = spot->floorz; @@ -5101,7 +5101,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_WolfAttack) // Compute position for spawning blood/puff angle = self->target->__f_AngleTo(self); - fixedvec3 bloodpos = self->target->_f_Vec3Angle(self->target->_f_radius(), angle, self->target->height >> 1); + fixedvec3 bloodpos = self->target->_f_Vec3Angle(self->target->_f_radius(), angle, self->target->_f_height() >> 1); int damage = flags & WAF_NORANDOM ? maxdamage : (1 + (pr_cabullet() % maxdamage)); @@ -5439,7 +5439,7 @@ static bool DoRadiusGive(AActor *self, AActor *thing, PClassActor *item, int amo { fixedvec3 diff = self->_f_Vec3To(thing); - diff.z += (thing->height - self->height) / 2; + diff.z += (thing->_f_height() - self->_f_height()) / 2; if (flags & RGF_CUBE) { // check if inside a cube double dx = fabs((double)(diff.x)); @@ -5524,7 +5524,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) else { FPortalGroupArray check(FPortalGroupArray::PGA_Full3d); - fixed_t mid = self->_f_Z() + self->height / 2; + fixed_t mid = self->_f_Z() + self->_f_height() / 2; FMultiBlockThingsIterator it(check, self->_f_X(), self->_f_Y(), mid-distance, mid+distance, distance, false, self->Sector); FMultiBlockThingsIterator::CheckResult cres; @@ -6356,11 +6356,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHigherOrLower) if (mobj != NULL && mobj != self) //AAPTR_DEFAULT is completely useless in this regard. { - if ((high) && (mobj->_f_Z() > ((includeHeight ? self->height : 0) + self->_f_Z() + offsethigh))) + if ((high) && (mobj->_f_Z() > ((includeHeight ? self->_f_height() : 0) + self->_f_Z() + offsethigh))) { ACTION_RETURN_STATE(high); } - else if ((low) && (mobj->_f_Z() + (includeHeight ? mobj->height : 0)) < (self->_f_Z() + offsetlow)) + else if ((low) && (mobj->_f_Z() + (includeHeight ? mobj->_f_height() : 0)) < (self->_f_Z() + offsetlow)) { ACTION_RETURN_STATE(low); } diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 6572014ee..da23b61e3 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -646,7 +646,7 @@ void InitThingdef() symt.AddSymbol(new PField(NAME_Score, TypeSInt32, VARF_Native, myoffsetof(AActor,Score))); symt.AddSymbol(new PField(NAME_Accuracy, TypeSInt32, VARF_Native, myoffsetof(AActor,accuracy))); symt.AddSymbol(new PField(NAME_Stamina, TypeSInt32, VARF_Native, myoffsetof(AActor,stamina))); - symt.AddSymbol(new PField(NAME_Height, TypeFixed, VARF_Native, myoffsetof(AActor,height))); + symt.AddSymbol(new PField(NAME_Height, TypeFloat64, VARF_Native, myoffsetof(AActor,Height))); symt.AddSymbol(new PField(NAME_Radius, TypeFloat64, VARF_Native, myoffsetof(AActor,radius))); symt.AddSymbol(new PField(NAME_ReactionTime,TypeSInt32, VARF_Native, myoffsetof(AActor,reactiontime))); symt.AddSymbol(new PField(NAME_MeleeRange, TypeFixed, VARF_Native, myoffsetof(AActor,meleerange))); diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 457f2454b..1325dcc42 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -633,8 +633,8 @@ DEFINE_PROPERTY(radius, F, Actor) //========================================================================== DEFINE_PROPERTY(height, F, Actor) { - PROP_FIXED_PARM(id, 0); - defaults->height=id; + PROP_DOUBLE_PARM(id, 0); + defaults->Height=id; } //========================================================================== @@ -642,7 +642,7 @@ DEFINE_PROPERTY(height, F, Actor) //========================================================================== DEFINE_PROPERTY(projectilepassheight, F, Actor) { - PROP_FIXED_PARM(id, 0); + PROP_DOUBLE_PARM(id, 0); defaults->projectilepassheight=id; } @@ -916,9 +916,9 @@ DEFINE_PROPERTY(explosiondamage, I, Actor) //========================================================================== DEFINE_PROPERTY(deathheight, F, Actor) { - PROP_FIXED_PARM(h, 0); + PROP_DOUBLE_PARM(h, 0); assert(info->IsKindOf(RUNTIME_CLASS(PClassActor))); - static_cast(info)->DeathHeight = MAX(0, h); + static_cast(info)->DeathHeight = MAX(0., h); } //========================================================================== @@ -926,9 +926,9 @@ DEFINE_PROPERTY(deathheight, F, Actor) //========================================================================== DEFINE_PROPERTY(burnheight, F, Actor) { - PROP_FIXED_PARM(h, 0); + PROP_DOUBLE_PARM(h, 0); assert(info->IsKindOf(RUNTIME_CLASS(PClassActor))); - static_cast(info)->BurnHeight = MAX(0, h); + static_cast(info)->BurnHeight = MAX(0., h); } //========================================================================== @@ -1320,7 +1320,7 @@ DEFINE_PROPERTY(radiusdamagefactor, F, Actor) //========================================================================== DEFINE_PROPERTY(cameraheight, F, Actor) { - PROP_FIXED_PARM(i, 0); + PROP_DOUBLE_PARM(i, 0); assert(info->IsKindOf(RUNTIME_CLASS(PClassActor))); static_cast(info)->CameraHeight = i; }