From c1b44a56943a37f363f0028587abac68111537e1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 18 Jan 2016 21:01:52 +0100 Subject: [PATCH] - let's make some use of AActor::Pos and get rid of some of those X() and Y() calls... - restore proper actor.h file. --- src/actor.h | 76 ++++++++++++++++---------------- src/b_func.cpp | 2 +- src/d_dehacked.cpp | 2 +- src/fragglescript/t_func.cpp | 2 +- src/g_doom/a_bossbrain.cpp | 2 +- src/g_doom/a_doomweaps.cpp | 3 +- src/g_doom/a_fatso.cpp | 2 +- src/g_doom/a_painelemental.cpp | 4 +- src/g_doom/a_revenant.cpp | 2 +- src/g_heretic/a_chicken.cpp | 2 +- src/g_heretic/a_dsparil.cpp | 6 +-- src/g_heretic/a_hereticmisc.cpp | 14 +++--- src/g_heretic/a_hereticweaps.cpp | 2 +- src/g_heretic/a_ironlich.cpp | 2 +- src/p_3dfloors.h | 4 ++ src/p_enemy.cpp | 6 +-- src/p_local.h | 12 +++++ src/p_things.cpp | 4 +- 18 files changed, 81 insertions(+), 66 deletions(-) diff --git a/src/actor.h b/src/actor.h index b12699558..46d9ae046 100644 --- a/src/actor.h +++ b/src/actor.h @@ -847,7 +847,7 @@ public: bool intersects(AActor *other) const { fixed_t blockdist = radius + other->radius; - return ( abs(pos.x - other->pos.x) < blockdist && abs(pos.y - other->pos.y) < blockdist); + return ( abs(x - other->x) < blockdist && abs(y - other->y) < blockdist); } PalEntry GetBloodColor() const @@ -888,99 +888,99 @@ public: // to distinguish between portal-aware and portal-unaware distance calculation. fixed_t AproxDistance(AActor *other, bool absolute = false) { - return P_AproxDistance(pos.x - other->pos.x, pos.y - other->pos.y); + return P_AproxDistance(x - other->x, y - other->y); } // same with 'ref' here. fixed_t AproxDistance(fixed_t otherx, fixed_t othery, AActor *ref = NULL) { - return P_AproxDistance(pos.x - otherx, pos.y - othery); + return P_AproxDistance(x - otherx, y - othery); } fixed_t AproxDistance(AActor *other, fixed_t xadd, fixed_t yadd, bool absolute = false) { - return P_AproxDistance(pos.x - other->pos.x + xadd, pos.y - other->pos.y + yadd); + return P_AproxDistance(x - other->x + xadd, y - other->y + yadd); } fixed_t AproxDistance3D(AActor *other, bool absolute = false) { - return P_AproxDistance(AproxDistance(other), pos.z - other->pos.z); + return P_AproxDistance(AproxDistance(other), z - other->z); } // more precise, but slower version, being used in a few places fixed_t Distance2D(AActor *other, bool absolute = false) { - return xs_RoundToInt(FVector2(pos.x - other->pos.x, pos.y - other->pos.y).Length()); + return xs_RoundToInt(FVector2(x - other->x, y - other->y).Length()); } // a full 3D version of the above fixed_t Distance3D(AActor *other, bool absolute = false) { - return xs_RoundToInt(FVector3(pos.x - other->pos.x, pos.y - other->pos.y, pos.z - other->pos.z).Length()); + return xs_RoundToInt(FVector3(x - other->x, y - other->y, z - other->z).Length()); } angle_t AngleTo(AActor *other, bool absolute = false) const { - return R_PointToAngle2(pos.x, pos.y, other->pos.x, other->pos.y); + return R_PointToAngle2(x, y, other->x, other->y); } angle_t AngleTo(AActor *other, fixed_t oxofs, fixed_t oyofs, bool absolute = false) const { - return R_PointToAngle2(pos.x, pos.y, other->pos.x + oxofs, other->pos.y + oyofs); + return R_PointToAngle2(x, y, other->x + oxofs, other->y + oyofs); } fixed_t AngleTo(fixed_t otherx, fixed_t othery, AActor *ref = NULL) { - return R_PointToAngle2(pos.x, pos.y, otherx, othery); + return R_PointToAngle2(x, y, otherx, othery); } fixed_t AngleXYTo(fixed_t myx, fixed_t myy, AActor *other, bool absolute = false) { - return R_PointToAngle2(myx, myy, other->pos.x, other->pos.y); + return R_PointToAngle2(myx, myy, other->x, other->y); } fixedvec2 Vec2To(AActor *other) const { - fixedvec2 ret = { other->pos.x - pos.x, other->pos.y - pos.y }; + fixedvec2 ret = { other->x - x, other->y - y }; return ret; } fixedvec3 Vec3To(AActor *other) const { - fixedvec3 ret = { other->pos.x - pos.x, other->pos.y - pos.y, other->pos.z - pos.z }; + fixedvec3 ret = { other->x - x, other->y - y, other->z - z }; return ret; } fixedvec2 Vec2Offset(fixed_t dx, fixed_t dy, bool absolute = false) const { - fixedvec2 ret = { pos.x + dx, pos.y + dy }; + fixedvec2 ret = { x + dx, y + dy }; return ret; } fixedvec2 Vec2Angle(fixed_t length, angle_t angle, bool absolute = false) const { - fixedvec2 ret = { pos.x + FixedMul(length, finecosine[angle >> ANGLETOFINESHIFT]), - pos.y + FixedMul(length, finesine[angle >> ANGLETOFINESHIFT]) }; + fixedvec2 ret = { x + FixedMul(length, finecosine[angle >> ANGLETOFINESHIFT]), + y + FixedMul(length, finesine[angle >> ANGLETOFINESHIFT]) }; return ret; } fixedvec3 Vec3Offset(fixed_t dx, fixed_t dy, fixed_t dz, bool absolute = false) const { - fixedvec3 ret = { pos.x + dx, pos.y + dy, pos.z + dz }; + fixedvec3 ret = { x + dx, y + dy, z + dz }; return ret; } fixedvec3 Vec3Angle(fixed_t length, angle_t angle, fixed_t dz, bool absolute = false) const { - fixedvec3 ret = { pos.x + FixedMul(length, finecosine[angle >> ANGLETOFINESHIFT]), - pos.y + FixedMul(length, finesine[angle >> ANGLETOFINESHIFT]), pos.z + dz }; + fixedvec3 ret = { x + FixedMul(length, finecosine[angle >> ANGLETOFINESHIFT]), + y + FixedMul(length, finesine[angle >> ANGLETOFINESHIFT]), z + dz }; return ret; } void Move(fixed_t dx, fixed_t dy, fixed_t dz) { - SetOrigin(pos.x + dx, pos.y + dy, pos.z + dz, true); + SetOrigin(x + dx, y + dy, z + dz, true); } void SetOrigin(const fixedvec3 & npos, bool moving) @@ -1007,10 +1007,7 @@ public: // info for drawing // NOTE: The first member variable *must* be x. -private: - fixedvec3 pos; -public: - //fixed_t x,y,z; + fixed_t x,y,z; AActor *snext, **sprev; // links in sector (if needed) angle_t angle; WORD sprite; // used to find patch_t and flip value @@ -1208,7 +1205,7 @@ public: void LinkToWorld (sector_t *sector); void UnlinkFromWorld (); void AdjustFloorClip (); - void SetOrigin (fixed_t x, fixed_t y, fixed_t z, bool moving); + void SetOrigin (fixed_t x, fixed_t y, fixed_t z, bool moving = false); bool InStateSequence(FState * newstate, FState * basestate); int GetTics(FState * newstate); bool SetState (FState *newstate, bool nofunction=false); @@ -1240,41 +1237,46 @@ public: fixed_t X() const { - return pos.x; + return x; } fixed_t Y() const { - return pos.y; + return y; } fixed_t Z() const { - return pos.z; + return z; } fixedvec3 Pos() const { fixedvec3 ret = { X(), Y(), Z() }; return ret; } + fixedvec3 PosPlusZ(fixed_t zadd) const + { + fixedvec3 ret = { X(), Y(), Z() + zadd }; + return ret; + } fixed_t Top() const { - return pos.z + height; + return z + height; } void SetZ(fixed_t newz, bool moving = true) { - pos.z = newz; + z = newz; } // These are not for general use as they do not link the actor into the world! - void SetXY(fixed_t x, fixed_t y) + void SetXY(fixed_t xx, fixed_t yy) { - pos.x = x; - pos.y = y; + x = xx; + y = yy; } - void SetXYZ(fixed_t x, fixed_t y, fixed_t z) + void SetXYZ(fixed_t xx, fixed_t yy, fixed_t zz) { - pos.x = x; - pos.y = y; - pos.z = z; + x = xx; + y = yy; + z = zz; } }; diff --git a/src/b_func.cpp b/src/b_func.cpp index cc8d9808a..eb86beba8 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -459,7 +459,7 @@ void FCajunMaster::SetBodyAt (fixed_t x, fixed_t y, fixed_t z, int hostnum) //Emulates missile travel. Returns distance travelled. fixed_t FCajunMaster::FakeFire (AActor *source, AActor *dest, ticcmd_t *cmd) { - AActor *th = Spawn ("CajunTrace", source->X(), source->Y(), source->Z() + 4*8*FRACUNIT, NO_REPLACE); + AActor *th = Spawn ("CajunTrace", source->PosPlusZ(4*8*FRACUNIT), NO_REPLACE); th->target = source; // where it came from diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 31ff05b64..35abd13a8 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -3056,7 +3056,7 @@ bool ADehackedPickup::TryPickup (AActor *&toucher) { return false; } - RealPickup = static_cast(Spawn (type, X(), Y(), Z(), NO_REPLACE)); + RealPickup = static_cast(Spawn (type, Pos(), NO_REPLACE)); if (RealPickup != NULL) { // The internally spawned item should never count towards statistics. diff --git a/src/fragglescript/t_func.cpp b/src/fragglescript/t_func.cpp index 2381ad381..0945b1b4f 100644 --- a/src/fragglescript/t_func.cpp +++ b/src/fragglescript/t_func.cpp @@ -4281,7 +4281,7 @@ void FParser::SF_SpawnShot2(void) t_return.type = svt_mobj; - AActor *mo = Spawn (PClass, source->X(), source->Y(), source->Z()+z, ALLOW_REPLACE); + AActor *mo = Spawn (PClass, source->PosPlusZ(z), ALLOW_REPLACE); if (mo) { S_Sound (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_NORM); diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index f69acd789..29bdd2be1 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -275,7 +275,7 @@ static void SpawnFly(AActor *self, const PClass *spawntype, FSoundID sound) if (!(newmobj->ObjectFlags & OF_EuthanizeMe)) { // telefrag anything in this spot - P_TeleportMove (newmobj, newmobj->X(), newmobj->Y(), newmobj->Z(), true); + P_TeleportMove (newmobj, newmobj->Pos(), true); } newmobj->flags4 |= MF4_BOSSSPAWNED; } diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index 85335587e..4021ad206 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -612,8 +612,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray) if (linetarget != NULL) { - AActor *spray = Spawn(spraytype, linetarget->X(), linetarget->Y(), - linetarget->Z() + (linetarget->height >> 2), ALLOW_REPLACE); + AActor *spray = Spawn(spraytype, linetarget->PosPlusZ(linetarget->height >> 2), 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 370e3fc69..9273febda 100644 --- a/src/g_doom/a_fatso.cpp +++ b/src/g_doom/a_fatso.cpp @@ -145,7 +145,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom) P_CheckSplash(self, 128<X(), self->Y(), self->Z(), NO_REPLACE); // We need something to aim at. + 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; for (i = -n; i <= n; i += 8) diff --git a/src/g_doom/a_painelemental.cpp b/src/g_doom/a_painelemental.cpp index cb5205a76..69d6ef448 100644 --- a/src/g_doom/a_painelemental.cpp +++ b/src/g_doom/a_painelemental.cpp @@ -80,7 +80,7 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype, int fixedvec2 dist = Vec2Angle(prestep, angle); fixedvec3 pos = self->Vec3Offset(dist.x, dist.y, 8 * FRACUNIT, true); - fixedvec3 src = { self->X(), self->Y(), self->Z() }; + fixedvec3 src = self->Pos(); for (int i = 0; i < 2; i++) { @@ -142,7 +142,7 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype, int // Check for movements. - if (!P_CheckPosition (other, other->X(), other->Y())) + if (!P_CheckPosition (other, other->Pos())) { // kill it immediately P_DamageMobj (other, self, self, TELEFRAG_DAMAGE, NAME_None); diff --git a/src/g_doom/a_revenant.cpp b/src/g_doom/a_revenant.cpp index 162cfd5fa..9b8821fb4 100644 --- a/src/g_doom/a_revenant.cpp +++ b/src/g_doom/a_revenant.cpp @@ -31,7 +31,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkelMissile) if (missile != NULL) { - missile->SetOrigin(missile->X() + missile->velx, missile->Y() + missile->vely, missile->Z(), false); + missile->SetOrigin(missile->Vec3Offset(missile->velx, missile->vely, 0), false); missile->tracer = self->target; } } diff --git a/src/g_heretic/a_chicken.cpp b/src/g_heretic/a_chicken.cpp index 3fcb15380..329b4d264 100644 --- a/src/g_heretic/a_chicken.cpp +++ b/src/g_heretic/a_chicken.cpp @@ -100,7 +100,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Feathers) } for (i = 0; i < count; i++) { - mo = Spawn("Feather", self->X(), self->Y(), self->Z()+20*FRACUNIT, NO_REPLACE); + mo = Spawn("Feather", self->PosPlusZ(20*FRACUNIT), NO_REPLACE); mo->target = self; mo->velx = pr_feathers.Random2() << 8; mo->vely = pr_feathers.Random2() << 8; diff --git a/src/g_heretic/a_dsparil.cpp b/src/g_heretic/a_dsparil.cpp index ba90335a7..d2bed5b68 100644 --- a/src/g_heretic/a_dsparil.cpp +++ b/src/g_heretic/a_dsparil.cpp @@ -146,7 +146,7 @@ void P_DSparilTeleport (AActor *actor) prevX = actor->X(); prevY = actor->Y(); prevZ = actor->Z(); - if (P_TeleportMove (actor, spot->X(), spot->Y(), spot->Z(), false)) + if (P_TeleportMove (actor, spot->Pos(), false)) { mo = Spawn("Sorcerer2Telefade", prevX, prevY, prevZ, ALLOW_REPLACE); if (mo) mo->Translation = actor->Translation; @@ -254,7 +254,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard) { AActor *mo; - mo = Spawn("Wizard", self->X(), self->Y(), self->Z(), ALLOW_REPLACE); + mo = Spawn("Wizard", self->Pos(), ALLOW_REPLACE); if (mo != NULL) { mo->SetZ(mo->Z() - mo->GetDefault()->height / 2, false); @@ -272,7 +272,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard) self->flags &= ~MF_MISSILE; mo->master = self->target; // Heretic did not offset it by TELEFOGHEIGHT, so I won't either. - Spawn (self->X(), self->Y(), self->Z(), ALLOW_REPLACE); + Spawn (self->Pos(), ALLOW_REPLACE); } } } diff --git a/src/g_heretic/a_hereticmisc.cpp b/src/g_heretic/a_hereticmisc.cpp index b495545a2..5a2b8dbec 100644 --- a/src/g_heretic/a_hereticmisc.cpp +++ b/src/g_heretic/a_hereticmisc.cpp @@ -57,7 +57,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain) } for (count = chance > 240 ? 2 : 1; count; count--) { - goo = Spawn(gootype, self->X(), self->Y(), self->Z() + 48*FRACUNIT, ALLOW_REPLACE); + goo = Spawn(gootype, self->PosPlusZ(48*FRACUNIT), ALLOW_REPLACE); goo->target = self; goo->velx = pr_podpain.Random2() << 9; goo->vely = pr_podpain.Random2() << 9; @@ -100,15 +100,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod) AActor *mo; fixed_t x; fixed_t y; - fixed_t z; if (self->special1 == MAX_GEN_PODS) { // Too many generated pods return; } - x = self->x; - y = self->y; - z = self->z; + x = self->X(); + y = self->Y(); mo = Spawn(podtype, x, y, ONFLOORZ, ALLOW_REPLACE); if (!P_CheckPosition (mo, x, y)) { // Didn't fit @@ -191,17 +189,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact) AActor *tiny; angle_t angle; - if (self->z <= self->floorz) + if (self->Z() <= self->floorz) { self->flags |= MF_NOGRAVITY; self->gravity = FRACUNIT; - self->z += 28*FRACUNIT; + self->SetZ(self->Z() + 28*FRACUNIT); //self->velz = 3*FRACUNIT; } P_RadiusAttack (self, self->target, 25, 25, NAME_Fire, RADF_HURTSOURCE); for (i = 0; i < 4; i++) { - tiny = Spawn("VolcanoTBlast", self->x, self->y, self->z, ALLOW_REPLACE); + tiny = Spawn("VolcanoTBlast", self->Pos(), ALLOW_REPLACE); tiny->target = self; angle = i*ANG90; tiny->angle = angle; diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index 997efe212..2121bf5a2 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -382,7 +382,7 @@ void FireMacePL1B (AActor *actor) if (!weapon->DepleteAmmo (weapon->bAltFire)) return; } - ball = Spawn("MaceFX2", actor->X(), actor->Y(), actor->Z() + 28*FRACUNIT - actor->floorclip, ALLOW_REPLACE); + ball = Spawn("MaceFX2", actor->PosPlusZ(28*FRACUNIT - actor->floorclip), ALLOW_REPLACE); ball->velz = 2*FRACUNIT+/*((player->lookdir)<<(FRACBITS-5))*/ finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)]; angle = actor->angle; diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index dd8122318..b09864bd0 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -200,7 +200,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact) DEFINE_ACTION_FUNCTION(AActor, A_LichFireGrow) { self->health--; - self->SetZ(self->Z + 9*FRACUNIT); + self->SetZ(self->Z() + 9*FRACUNIT); if (self->health == 0) { self->Damage = self->GetDefault()->Damage; diff --git a/src/p_3dfloors.h b/src/p_3dfloors.h index 8abd23f03..0dfdf872c 100644 --- a/src/p_3dfloors.h +++ b/src/p_3dfloors.h @@ -144,6 +144,10 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li secplane_t P_FindFloorPlane(sector_t * sector, fixed_t x, fixed_t y, fixed_t z); int P_Find3DFloor(sector_t * sec, fixed_t x, fixed_t y, fixed_t z, bool above, bool floor, fixed_t &cmpz); +inline int P_Find3DFloor(sector_t * sec, const fixedvec3 &pos, bool above, bool floor, fixed_t &cmpz) +{ + return P_Find3DFloor(sec, pos.x, pos.y, pos.z, above, floor, cmpz); +} #endif \ No newline at end of file diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index d8230a031..14d417679 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2547,8 +2547,8 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) if (testsec) { fixed_t zdist1, zdist2; - if (P_Find3DFloor(testsec, corpsehit->X(), corpsehit->Y(), corpsehit->Z(), false, true, zdist1) - != P_Find3DFloor(testsec, self->X(), self->Y(), self->Z(), false, true, zdist2)) + if (P_Find3DFloor(testsec, corpsehit->Pos(), false, true, zdist1) + != P_Find3DFloor(testsec, self->Pos(), false, true, zdist2)) { // Not on same floor if (vilesec == corpsec || abs(zdist1 - self->Z()) > self->height) @@ -2565,7 +2565,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) corpsehit->flags |= MF_SOLID; corpsehit->height = corpsehit->GetDefault()->height; - bool check = P_CheckPosition(corpsehit, corpsehit->X(), corpsehit->Y()); + bool check = P_CheckPosition(corpsehit, corpsehit->Pos()); corpsehit->flags = oldflags; corpsehit->radius = oldradius; corpsehit->height = oldheight; diff --git a/src/p_local.h b/src/p_local.h index 7e00276bd..8c4a94bfc 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -134,6 +134,10 @@ enum EPuffFlags }; AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, angle_t dir, int updown, int flags = 0, AActor *vict = NULL); +inline AActor *P_SpawnPuff(AActor *source, const PClass *pufftype, const fixedvec3 &pos, angle_t dir, int updown, int flags = 0, AActor *vict = NULL) +{ + return P_SpawnPuff(source, pufftype, pos.x, pos.y, pos.z, dir, updown, flags, vict); +} void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AActor *originator); void P_BloodSplatter (fixed_t x, fixed_t y, fixed_t z, AActor *originator); void P_BloodSplatter2 (fixed_t x, fixed_t y, fixed_t z, AActor *originator); @@ -458,6 +462,10 @@ bool P_TestMobjLocation (AActor *mobj); bool P_TestMobjZ (AActor *mobj, bool quick=true, AActor **pOnmobj = NULL); bool P_CheckPosition (AActor *thing, fixed_t x, fixed_t y, FCheckPosition &tm, bool actorsonly=false); bool P_CheckPosition (AActor *thing, fixed_t x, fixed_t y, bool actorsonly=false); +inline bool P_CheckPosition(AActor *thing, const fixedvec3 &pos, bool actorsonly = false) +{ + return P_CheckPosition(thing, pos.x, pos.y, actorsonly); +} AActor *P_CheckOnmobj (AActor *thing); void P_FakeZMovement (AActor *mo); bool P_TryMove (AActor* thing, fixed_t x, fixed_t y, int dropoff, const secplane_t * onfloor, FCheckPosition &tm, bool missileCheck = false); @@ -465,6 +473,10 @@ bool P_TryMove (AActor* thing, fixed_t x, fixed_t y, int dropoff, const secplane bool P_CheckMove(AActor *thing, fixed_t x, fixed_t y); void P_ApplyTorque(AActor *mo); bool P_TeleportMove (AActor* thing, fixed_t x, fixed_t y, fixed_t z, bool telefrag, bool modifyactor = true); // [RH] Added z and telefrag parameters +inline bool P_TeleportMove(AActor* thing, const fixedvec3 &pos, bool telefrag, bool modifyactor = true) +{ + return P_TeleportMove(thing, pos.x, pos.y, pos.z, telefrag, modifyactor); +} void P_PlayerStartStomp (AActor *actor); // [RH] Stomp on things for a newly spawned player void P_SlideMove (AActor* mo, fixed_t tryx, fixed_t tryy, int numsteps); bool P_BounceWall (AActor *mo); diff --git a/src/p_things.cpp b/src/p_things.cpp index 80ce3a5cf..f487128e8 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -436,7 +436,7 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser) thing->flags |= MF_SOLID; thing->height = info->height; // [RH] Use real height thing->radius = info->radius; // [RH] Use real radius - if (!P_CheckPosition (thing, thing->X(), thing->Y())) + if (!P_CheckPosition (thing, thing->Pos())) { thing->flags = oldflags; thing->radius = oldradius; @@ -478,7 +478,7 @@ bool P_Thing_CanRaise(AActor *thing) thing->height = info->height; thing->radius = info->radius; - bool check = P_CheckPosition (thing, thing->X(), thing->Y()); + bool check = P_CheckPosition (thing, thing->Pos()); // Restore checked properties thing->flags = oldflags;