diff --git a/src/actor.h b/src/actor.h index 10194d031..641099a07 100644 --- a/src/actor.h +++ b/src/actor.h @@ -860,6 +860,11 @@ public: return (DVector2(_f_X() - otherpos.x, _f_Y() - otherpos.y).Length())/FRACUNIT; } + double Distance2D(double x, double y) const + { + return DVector2(X() - x, Y() - y).Length(); + } + // a full 3D version of the above fixed_t Distance3D(AActor *other, bool absolute = false) { @@ -1438,6 +1443,7 @@ public: void AddZ(double newz, bool moving = true) { __pos.z += FLOAT2FIXED(newz); + if (!moving) PrevZ = __pos.z; } // These are not for general use as they do not link the actor into the world! diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index 0b14d61e7..90aaa1a4e 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -500,7 +500,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireSTGrenade) // Temporarily raise the pitch to send the grenade slightly upwards DAngle SavedPlayerPitch = self->Angles.Pitch; - self->Angles.Pitch -= 6.328125; //(1152 << FRACBITS); + self->Angles.Pitch -= 6.328125; //(1152 << F RACBITS); P_SpawnPlayerMissile(self, grenade); self->Angles.Pitch = SavedPlayerPitch; return 0; diff --git a/src/g_heretic/a_dsparil.cpp b/src/g_heretic/a_dsparil.cpp index 2e85e071a..2bd00c28c 100644 --- a/src/g_heretic/a_dsparil.cpp +++ b/src/g_heretic/a_dsparil.cpp @@ -67,8 +67,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack) PARAM_ACTION_PROLOGUE; AActor *mo; - fixed_t vz; - angle_t angle; + DAngle angle; if (!self->target) { @@ -86,17 +85,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack) PClassActor *fx = PClass::FindActor("SorcererFX1"); if (self->health > (self->SpawnHealth()/3)*2) { // Spit one fireball - P_SpawnMissileZ (self, self->_f_Z() + 48*FRACUNIT, self->target, fx ); + P_SpawnMissileZ (self, self->Z() + 48, self->target, fx ); } else { // Spit three fireballs - mo = P_SpawnMissileZ (self, self->_f_Z() + 48*FRACUNIT, self->target, fx); + mo = P_SpawnMissileZ (self, self->Z() + 48, self->target, fx); if (mo != NULL) { - vz = mo->_f_velz(); - angle = mo->_f_angle(); - P_SpawnMissileAngleZ (self, self->_f_Z() + 48*FRACUNIT, fx, angle-ANGLE_1*3, vz); - P_SpawnMissileAngleZ (self, self->_f_Z() + 48*FRACUNIT, fx, angle+ANGLE_1*3, vz); + angle = mo->Angles.Yaw; + P_SpawnMissileAngleZ(self, self->Z() + 48, fx, angle - 3, mo->Vel.Z); + P_SpawnMissileAngleZ(self, self->Z() + 48, fx, angle + 3, mo->Vel.Z); } if (self->health < self->SpawnHealth()/3) { // Maybe attack again @@ -143,24 +141,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcererRise) void P_DSparilTeleport (AActor *actor) { - fixed_t prevX; - fixed_t prevY; - fixed_t prevZ; + DVector3 prev; AActor *mo; AActor *spot; DSpotState *state = DSpotState::GetSpotState(); if (state == NULL) return; - spot = state->GetSpotWithMinMaxDistance(PClass::FindClass("BossSpot"), actor->_f_X(), actor->_f_Y(), 128*FRACUNIT, 0); + spot = state->GetSpotWithMinMaxDistance(PClass::FindClass("BossSpot"), actor->X(), actor->Y(), 128, 0); if (spot == NULL) return; - prevX = actor->_f_X(); - prevY = actor->_f_Y(); - prevZ = actor->_f_Z(); - if (P_TeleportMove (actor, spot->_f_Pos(), false)) + prev = actor->Pos(); + if (P_TeleportMove (actor, spot->Pos(), false)) { - mo = Spawn("Sorcerer2Telefade", prevX, prevY, prevZ, ALLOW_REPLACE); + mo = Spawn("Sorcerer2Telefade", prev, ALLOW_REPLACE); if (mo) mo->Translation = actor->Translation; S_Sound (mo, CHAN_BODY, "misc/teleport", 1, ATTN_NORM); actor->SetState (actor->FindState("Teleport")); @@ -230,8 +224,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Attack) PClassActor *fx = PClass::FindActor("Sorcerer2FX2"); if (fx) { - P_SpawnMissileAngle (self, fx, self->_f_angle()-ANG45, FRACUNIT/2); - P_SpawnMissileAngle (self, fx, self->_f_angle()+ANG45, FRACUNIT/2); + P_SpawnMissileAngle(self, fx, self->Angles.Yaw - 45, 0.5); + P_SpawnMissileAngle(self, fx, self->Angles.Yaw + 45, 0.5); } } else @@ -279,7 +273,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard) mo = Spawn("Wizard", self->Pos(), ALLOW_REPLACE); if (mo != NULL) { - mo->_f_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_hereticartifacts.cpp b/src/g_heretic/a_hereticartifacts.cpp index 42a787580..73e7e55e0 100644 --- a/src/g_heretic/a_hereticartifacts.cpp +++ b/src/g_heretic/a_hereticartifacts.cpp @@ -49,12 +49,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_TimeBomb) { PARAM_ACTION_PROLOGUE; - self->_f_AddZ(32*FRACUNIT, false); - self->PrevZ = self->_f_Z(); // no interpolation! + self->AddZ(32, false); self->RenderStyle = STYLE_Add; self->alpha = FRACUNIT; P_RadiusAttack (self, self->target, 128, 128, self->DamageType, RADF_HURTSOURCE); - P_CheckSplash(self, 128<_f_angle() >> ANGLETOFINESHIFT; AActor *mo = Spawn("ActivatedTimeBomb", - Owner->_f_Vec3Angle(24*FRACUNIT, Owner->_f_angle(), - Owner->floorclip), ALLOW_REPLACE); + Owner->Vec3Angle(24., Owner->Angles.Yaw, - FIXED2FLOAT(Owner->floorclip)), ALLOW_REPLACE); mo->target = Owner; return true; } diff --git a/src/g_heretic/a_hereticmisc.cpp b/src/g_heretic/a_hereticmisc.cpp index b60cfdb69..bbfd9ceff 100644 --- a/src/g_heretic/a_hereticmisc.cpp +++ b/src/g_heretic/a_hereticmisc.cpp @@ -59,7 +59,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain) } for (count = chance > 240 ? 2 : 1; count; count--) { - goo = Spawn(gootype, self->PosPlusZ(48*FRACUNIT), ALLOW_REPLACE); + goo = Spawn(gootype, self->PosPlusZ(48.), ALLOW_REPLACE); goo->target = self; goo->Vel.X = pr_podpain.Random2() / 128.; goo->Vel.Y = pr_podpain.Random2() / 128.; @@ -104,17 +104,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod) PARAM_CLASS_OPT(podtype, AActor) { podtype = PClass::FindActor("Pod"); } AActor *mo; - fixed_t x; - fixed_t y; if (self->special1 == MAX_GEN_PODS) { // Too many generated pods return 0; } - x = self->_f_X(); - y = self->_f_Y(); - mo = Spawn(podtype, x, y, ONFLOORZ, ALLOW_REPLACE); - if (!P_CheckPosition (mo, x, y)) + mo = Spawn(podtype, self->PosAtZ(ONFLOORZ), ALLOW_REPLACE); + if (!P_CheckPosition (mo, mo->Pos())) { // Didn't fit mo->Destroy (); return 0; diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index 7abf1ef00..3d1911377 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -121,18 +121,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL1) AWeapon *weapon = player->ReadyWeapon; if (weapon != NULL) { - if (!weapon->DepleteAmmo (weapon->bAltFire)) + if (!weapon->DepleteAmmo(weapon->bAltFire)) return 0; } DAngle pitch = P_BulletSlope(self); - damage = 7+(pr_fgw()&7); + damage = 7 + (pr_fgw() & 7); angle = self->Angles.Yaw; if (player->refire) { angle += pr_fgw.Random2() * (5.625 / 256); } - P_LineAttack (self, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Hitscan, "GoldWandPuff1"); - S_Sound (self, CHAN_WEAPON, "weapons/wandhit", 1, ATTN_NORM); + P_LineAttack(self, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Hitscan, "GoldWandPuff1"); + S_Sound(self, CHAN_WEAPON, "weapons/wandhit", 1, ATTN_NORM); return 0; } @@ -149,7 +149,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2) int i; DAngle angle; int damage; - fixed_t vz; + double vz; player_t *player; if (NULL == (player = self->player)) @@ -164,11 +164,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2) return 0; } DAngle pitch = P_BulletSlope(self); - //momz = GetDefault()->Speed * tan(-bulletpitch); - vz = fixed_t(GetDefaultByName("GoldWandFX2")->_f_speed() * -pitch.TanClamped()); - P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->_f_angle()-(ANG45/8), vz); - P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->_f_angle()+(ANG45/8), vz); + vz = -GetDefaultByName("GoldWandFX2")->Speed * pitch.TanClamped(); + P_SpawnMissileAngle(self, PClass::FindActor("GoldWandFX2"), self->Angles.Yaw - (45. / 8), vz); + P_SpawnMissileAngle(self, PClass::FindActor("GoldWandFX2"), self->Angles.Yaw + (45. / 8), vz); angle = self->Angles.Yaw - (45. / 8); for(i = 0; i < 5; i++) { @@ -406,7 +405,7 @@ void FireMacePL1B (AActor *actor) ball->Vel.Z = 2 - player->mo->Angles.Pitch.TanClamped(); ball->target = actor; ball->Angles.Yaw = actor->Angles.Yaw; - ball->_f_AddZ(ball->_f_velz()); + ball->AddZ(ball->Vel.Z); ball->VelFromAngle(); ball->Vel += actor->Vel.XY()/2; S_Sound (ball, CHAN_BODY, "weapons/maceshoot", 1, ATTN_NORM); @@ -433,18 +432,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1) if (pr_maceatk() < 28) { - FireMacePL1B (self); + FireMacePL1B(self); return 0; } AWeapon *weapon = player->ReadyWeapon; if (weapon != NULL) { - if (!weapon->DepleteAmmo (weapon->bAltFire)) + if (!weapon->DepleteAmmo(weapon->bAltFire)) return 0; } - player->psprites[ps_weapon].sx = ((pr_maceatk()&3)-2)*FRACUNIT; - player->psprites[ps_weapon].sy = WEAPONTOP+(pr_maceatk()&3)*FRACUNIT; - ball = P_SpawnPlayerMissile (self, PClass::FindActor("MaceFX1"), self->Angles.Yaw + (((pr_maceatk()&7)-4) * (360./256))); + player->psprites[ps_weapon].sx = ((pr_maceatk() & 3) - 2)*FRACUNIT; + player->psprites[ps_weapon].sy = WEAPONTOP + (pr_maceatk() & 3)*FRACUNIT; + ball = P_SpawnPlayerMissile(self, PClass::FindActor("MaceFX1"), self->Angles.Yaw + (((pr_maceatk() & 7) - 4) * (360. / 256))); if (ball) { ball->special1 = 16; // tics till dropoff @@ -477,9 +476,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check) // [RH] Avoid some precision loss by scaling the velocity directly #if 0 // This is the original code, for reference. - angle_t angle = self->_f_angle()>>ANGLETOFINESHIFT; - self->vel.x = FixedMul(7*FRACUNIT, finecosine[angle]); - self->vel.y = FixedMul(7*FRACUNIT, finesine[angle]); + a.ngle_t angle = self->_f_angle()>>ANGLETOF.INESHIFT; + self->vel.x = F.ixedMul(7*F.RACUNIT, f.inecosine[angle]); + self->vel.y = F.ixedMul(7*F.RACUNIT, f.inesine[angle]); #else double velscale = 7 / self->Vel.XY().Length(); self->Vel.X *= velscale; @@ -721,7 +720,7 @@ void ABlasterFX1::Effect () { if (pr_bfx1t() < 64) { - Spawn("BlasterSmoke", _f_X(), _f_Y(), MAX (_f_Z() - 8 * FRACUNIT, floorz), ALLOW_REPLACE); + Spawn("BlasterSmoke", PosAtZ(MAX(Z() - 8., FIXED2DBL(floorz))), ALLOW_REPLACE); } } @@ -1319,10 +1318,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2) } slope = -self->Angles.Pitch.TanClamped(); - fixed_t xo = (pr_fp2.Random2() << 9); - fixed_t yo = (pr_fp2.Random2() << 9); - fixedvec3 pos = self->Vec3Offset(xo, yo, - 26*FRACUNIT + FLOAT2FIXED(slope) - self->floorclip); + double xo = pr_fp2.Random2() / 128.; + double yo = pr_fp2.Random2() / 128.; + DVector3 pos = self->Vec3Offset(xo, yo, 26 + slope - FIXED2FLOAT(self->floorclip)); slope += 0.1; mo = Spawn("PhoenixFX2", pos, ALLOW_REPLACE); diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index d019357fc..0b0e29e86 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -127,7 +127,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack) mo = P_SpawnMissile (self, target, RUNTIME_CLASS(AWhirlwind)); if (mo != NULL) { - mo->_f_AddZ(-32*FRACUNIT, false); + mo->AddZ(-32); mo->tracer = target; mo->health = 20*TICRATE; // Duration S_Sound (self, CHAN_BODY, "ironlich/attack3", 1, ATTN_NORM); @@ -150,20 +150,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek) if (self->health < 0) { self->Vel.Zero(); - self->SetState (self->FindState(NAME_Death)); + self->SetState(self->FindState(NAME_Death)); self->flags &= ~MF_MISSILE; return 0; } if ((self->threshold -= 3) < 0) { self->threshold = 58 + (pr_seek() & 31); - S_Sound (self, CHAN_BODY, "ironlich/attack3", 1, ATTN_NORM); + S_Sound(self, CHAN_BODY, "ironlich/attack3", 1, ATTN_NORM); } if (self->tracer && self->tracer->flags&MF_SHADOW) { return 0; } - P_SeekerMissile (self, ANGLE_1*10, ANGLE_1*30); + P_SeekerMissile(self, ANGLE_1 * 10, ANGLE_1 * 30); return 0; } @@ -203,7 +203,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichFireGrow) PARAM_ACTION_PROLOGUE; self->health--; - self->_f_AddZ(9*FRACUNIT); + self->AddZ(9.); if (self->health == 0) { self->Damage = self->GetDefault()->Damage; diff --git a/src/g_heretic/a_knight.cpp b/src/g_heretic/a_knight.cpp index f8b8700d7..f8f79bb67 100644 --- a/src/g_heretic/a_knight.cpp +++ b/src/g_heretic/a_knight.cpp @@ -25,9 +25,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_DripBlood) AActor *mo; - fixed_t xo = (pr_dripblood.Random2() << 11); - fixed_t yo = (pr_dripblood.Random2() << 11); - mo = Spawn ("Blood", self->Vec3Offset(xo, yo, 0), ALLOW_REPLACE); + double xo = pr_dripblood.Random2() / 32.; + double yo = pr_dripblood.Random2() / 32.; + mo = Spawn ("Blood", self->Vec3Offset(xo, yo, 0.), ALLOW_REPLACE); mo->Vel.X = pr_dripblood.Random2 () / 64.; mo->Vel.Y = pr_dripblood.Random2() / 64.; mo->gravity = FRACUNIT/8; @@ -60,11 +60,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_KnightAttack) S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NORM); if (self->flags & MF_SHADOW || pr_knightatk () < 40) { // Red axe - P_SpawnMissileZ (self, self->_f_Z() + 36*FRACUNIT, self->target, PClass::FindActor("RedAxe")); + P_SpawnMissileZ (self, self->Z() + 36, self->target, PClass::FindActor("RedAxe")); return 0; } // Green axe - P_SpawnMissileZ (self, self->_f_Z() + 36*FRACUNIT, self->target, PClass::FindActor("KnightAxe")); + P_SpawnMissileZ (self, self->Z() + 36, self->target, PClass::FindActor("KnightAxe")); return 0; } diff --git a/src/g_heretic/a_wizard.cpp b/src/g_heretic/a_wizard.cpp index 9fa858098..51a01efc5 100644 --- a/src/g_heretic/a_wizard.cpp +++ b/src/g_heretic/a_wizard.cpp @@ -88,8 +88,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3) mo = P_SpawnMissile (self, self->target, fx); if (mo != NULL) { - P_SpawnMissileAngle(self, fx, mo->_f_angle()-(ANG45/8), mo->_f_velz()); - P_SpawnMissileAngle(self, fx, mo->_f_angle()+(ANG45/8), mo->_f_velz()); + P_SpawnMissileAngle(self, fx, mo->Angles.Yaw - 45. / 8, mo->Vel.Z); + P_SpawnMissileAngle(self, fx, mo->Angles.Yaw + 45. / 8, mo->Vel.Z); } return 0; } diff --git a/src/g_shared/a_specialspot.cpp b/src/g_shared/a_specialspot.cpp index bdbedae09..ae163df9d 100644 --- a/src/g_shared/a_specialspot.cpp +++ b/src/g_shared/a_specialspot.cpp @@ -149,17 +149,17 @@ struct FSpotList // //---------------------------------------------------------------------------- - ASpecialSpot *GetSpotWithMinMaxDistance(fixed_t x, fixed_t y, fixed_t mindist, fixed_t maxdist) + ASpecialSpot *GetSpotWithMinMaxDistance(double x, double y, double mindist, double maxdist) { if (Spots.Size() == 0) return NULL; int i = pr_spot() % Spots.Size(); int initial = i; - fixed_t distance; + double distance; while (true) { - distance = Spots[i]->AproxDistance(x, y); + distance = Spots[i]->Distance2D(x, y); if ((distance >= mindist) && ((maxdist == 0) || (distance <= maxdist))) break; @@ -337,7 +337,7 @@ ASpecialSpot *DSpotState::GetNextInList(const PClass *type, int skipcounter) // //---------------------------------------------------------------------------- -ASpecialSpot *DSpotState::GetSpotWithMinMaxDistance(const PClass *type, fixed_t x, fixed_t y, fixed_t mindist, fixed_t maxdist) +ASpecialSpot *DSpotState::GetSpotWithMinMaxDistance(const PClass *type, double x, double y, double mindist, double maxdist) { FSpotList *list = FindSpotList(type); if (list != NULL) return list->GetSpotWithMinMaxDistance(x, y, mindist, maxdist); diff --git a/src/g_shared/a_specialspot.h b/src/g_shared/a_specialspot.h index 937814280..db148b19d 100644 --- a/src/g_shared/a_specialspot.h +++ b/src/g_shared/a_specialspot.h @@ -36,7 +36,7 @@ public: bool RemoveSpot(ASpecialSpot *spot); void Serialize(FArchive &arc); ASpecialSpot *GetNextInList(const PClass *type, int skipcounter); - ASpecialSpot *GetSpotWithMinMaxDistance(const PClass *type, fixed_t x, fixed_t y, fixed_t mindist, fixed_t maxdist); + ASpecialSpot *GetSpotWithMinMaxDistance(const PClass *type, double x, double y, double mindist, double maxdist); ASpecialSpot *GetRandomSpot(const PClass *type, bool onlyonce = false); }; diff --git a/src/g_strife/a_thingstoblowup.cpp b/src/g_strife/a_thingstoblowup.cpp index d98488e26..5e4b5deff 100644 --- a/src/g_strife/a_thingstoblowup.cpp +++ b/src/g_strife/a_thingstoblowup.cpp @@ -81,7 +81,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Explode512) { self->target->player->extralight = 5; } - P_CheckSplash(self, 512<RenderStyle = STYLE_Add; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 2e9f7c4f4..155d6810b 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -3301,7 +3301,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Detonate) PARAM_ACTION_PROLOGUE; int damage = self->GetMissileDamage(0, 1); P_RadiusAttack (self, self->target, damage, damage, self->DamageType, RADF_HURTSOURCE); - P_CheckSplash(self, damage<Sector->_f_LowestFloorAt(self, &floorsec); - if (self->_f_Z() <= self->floorz + distance && self->floorsector == floorsec && self->Sector->GetHeightSec() == NULL && floorsec->heightsec == NULL) + if (self->_f_Z() <= self->floorz + FLOAT2FIXED(distance) && self->floorsector == floorsec && self->Sector->GetHeightSec() == NULL && floorsec->heightsec == NULL) { // Explosion splashes never alert monsters. This is because A_Explode has // a separate parameter for that so this would get in the way of proper diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 7f0e7b39d..c8db98926 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1104,7 +1104,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Explode) } P_RadiusAttack (self, self->target, damage, distance, self->DamageType, flags, fulldmgdistance); - P_CheckSplash(self, distance<target != NULL && self->target->player != NULL) { validcount++; @@ -1147,7 +1147,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusThrust) } P_RadiusAttack (self, self->target, force, distance, self->DamageType, flags | RADF_NODAMAGE, fullthrustdistance); - P_CheckSplash(self, distance << FRACBITS); + P_CheckSplash(self, distance); if (sourcenothrust) { @@ -4711,8 +4711,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport) PARAM_CLASS_OPT (target_type, ASpecialSpot) { target_type = PClass::FindActor("BossSpot"); } PARAM_CLASS_OPT (fog_type, AActor) { fog_type = PClass::FindActor("TeleportFog"); } PARAM_INT_OPT (flags) { flags = 0; } - PARAM_FIXED_OPT (mindist) { mindist = 128 << FRACBITS; } - PARAM_FIXED_OPT (maxdist) { maxdist = 128 << FRACBITS; } + PARAM_FLOAT_OPT (mindist) { mindist = 128; } + PARAM_FLOAT_OPT (maxdist) { maxdist = 0; } PARAM_INT_OPT (ptr) { ptr = AAPTR_DEFAULT; } AActor *ref = COPY_AAPTR(self, ptr); @@ -4771,7 +4771,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport) target_type = PClass::FindActor("BossSpot"); } - AActor *spot = state->GetSpotWithMinMaxDistance(target_type, ref->_f_X(), ref->_f_Y(), mindist, maxdist); + AActor *spot = state->GetSpotWithMinMaxDistance(target_type, ref->X(), ref->Y(), mindist, maxdist); if (spot == NULL) { return numret;