diff --git a/src/g_hexen/a_dragon.cpp b/src/g_hexen/a_dragon.cpp index d33e7b07b..7b160a689 100644 --- a/src/g_hexen/a_dragon.cpp +++ b/src/g_hexen/a_dragon.cpp @@ -60,14 +60,14 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax) actor->velx = FixedMul (actor->Speed, finecosine[angle]); actor->vely = FixedMul (actor->Speed, finesine[angle]); dist = actor->AproxDistance (target) / actor->Speed; - if (actor->z+actor->height < target->z || - target->z+target->height < actor->z) + if (actor->Top() < target->Z() || + target->Top() < actor->Z()) { if (dist < 1) { dist = 1; } - actor->velz = (target->z - actor->z)/dist; + actor->velz = (target->Z() - actor->Z())/dist; } if (target->flags&MF_SHOOTABLE && pr_dragonseek() < 64) { // attack the destination mobj if it's attackable @@ -252,11 +252,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFX2) delay = 16+(pr_dragonfx2()>>3); for (i = 1+(pr_dragonfx2()&3); i; i--) { - fixed_t x = self->x+((pr_dragonfx2()-128)<<14); - fixed_t y = self->y+((pr_dragonfx2()-128)<<14); - fixed_t z = self->z+((pr_dragonfx2()-128)<<12); + fixedvec3 pos = self->Vec3Offset( + ((pr_dragonfx2()-128)<<14), + ((pr_dragonfx2()-128)<<14), + ((pr_dragonfx2()-128)<<12)); - mo = Spawn ("DragonExplosion", x, y, z, ALLOW_REPLACE); + mo = Spawn ("DragonExplosion", pos, ALLOW_REPLACE); if (mo) { mo->tics = delay+(pr_dragonfx2()&3)*i*2; @@ -288,7 +289,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonPain) DEFINE_ACTION_FUNCTION(AActor, A_DragonCheckCrash) { - if (self->z <= self->floorz) + if (self->Z() <= self->floorz) { self->SetState (self->FindState ("Crash")); } diff --git a/src/g_hexen/a_fighterquietus.cpp b/src/g_hexen/a_fighterquietus.cpp index 846b30281..ae6df183c 100644 --- a/src/g_hexen/a_fighterquietus.cpp +++ b/src/g_hexen/a_fighterquietus.cpp @@ -36,7 +36,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropWeaponPieces) const PClass *cls = j==0? p1 : j==1? p2 : p3; if (cls) { - AActor *piece = Spawn (cls, self->x, self->y, self->z, ALLOW_REPLACE); + AActor *piece = Spawn (cls, self->Pos(), ALLOW_REPLACE); if (piece != NULL) { piece->velx = self->velx + finecosine[fineang]; @@ -112,10 +112,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FSwordFlames) for (i = 1+(pr_fswordflame()&3); i; i--) { - fixed_t x = self->x+((pr_fswordflame()-128)<<12); - fixed_t y = self->y+((pr_fswordflame()-128)<<12); - fixed_t z = self->z+((pr_fswordflame()-128)<<11); - Spawn ("FSwordFlame", x, y, z, ALLOW_REPLACE); + fixedvec3 pos = self->Vec3Offset( + ((pr_fswordflame()-128)<<12), + ((pr_fswordflame()-128)<<12), + ((pr_fswordflame()-128)<<11)); + Spawn ("FSwordFlame", pos, ALLOW_REPLACE); } } diff --git a/src/g_hexen/a_firedemon.cpp b/src/g_hexen/a_firedemon.cpp index c003dc21d..72981df97 100644 --- a/src/g_hexen/a_firedemon.cpp +++ b/src/g_hexen/a_firedemon.cpp @@ -32,7 +32,6 @@ static FRandom pr_firedemonsplotch ("FiredSplotch"); void A_FiredSpawnRock (AActor *actor) { AActor *mo; - int x,y,z; const PClass *rtype; switch (pr_firedemonrock() % 5) @@ -55,10 +54,11 @@ void A_FiredSpawnRock (AActor *actor) break; } - x = actor->x + ((pr_firedemonrock() - 128) << 12); - y = actor->y + ((pr_firedemonrock() - 128) << 12); - z = actor->z + ( pr_firedemonrock() << 11); - mo = Spawn (rtype, x, y, z, ALLOW_REPLACE); + fixedvec3 pos = actor->Vec3Offset( + ((pr_firedemonrock() - 128) << 12), + ((pr_firedemonrock() - 128) << 12), + ( pr_firedemonrock() << 11)); + mo = Spawn (rtype, pos, ALLOW_REPLACE); if (mo) { mo->target = actor; @@ -97,7 +97,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredRocks) DEFINE_ACTION_FUNCTION(AActor, A_SmBounce) { // give some more velocity (x,y,&z) - self->z = self->floorz + FRACUNIT; + self->SetZ(self->floorz + FRACUNIT); self->velz = (2*FRACUNIT) + (pr_smbounce() << 10); self->velx = pr_smbounce()%3<vely = pr_smbounce()%3<threshold) self->threshold--; // Float up and down - self->z += finesine[weaveindex << BOBTOFINESHIFT] * 8; + self->SetZ(self->Z() + finesine[weaveindex << BOBTOFINESHIFT] * 8); self->special1 = (weaveindex + 2) & 63; // Ensure it stays above certain height - if (self->z < self->floorz + (64*FRACUNIT)) + if (self->Z() < self->floorz + (64*FRACUNIT)) { - self->z += 2*FRACUNIT; + self->SetZ(self->Z() + 2*FRACUNIT); } if(!self->target || !(self->target->flags&MF_SHOOTABLE)) @@ -219,14 +219,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredSplotch) { AActor *mo; - mo = Spawn ("FireDemonSplotch1", self->x, self->y, self->z, ALLOW_REPLACE); + mo = Spawn ("FireDemonSplotch1", self->Pos(), ALLOW_REPLACE); if (mo) { mo->velx = (pr_firedemonsplotch() - 128) << 11; mo->vely = (pr_firedemonsplotch() - 128) << 11; mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3; } - mo = Spawn ("FireDemonSplotch2", self->x, self->y, self->z, ALLOW_REPLACE); + mo = Spawn ("FireDemonSplotch2", self->Pos(), ALLOW_REPLACE); if (mo) { mo->velx = (pr_firedemonsplotch() - 128) << 11; diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index 1a9461ae8..47869c48a 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -51,10 +51,10 @@ bool AArtiPoisonBag1::Use (bool pickup) angle_t angle = Owner->angle >> ANGLETOFINESHIFT; AActor *mo; - mo = Spawn ("PoisonBag", - Owner->x+16*finecosine[angle], - Owner->y+24*finesine[angle], Owner->z- - Owner->floorclip+8*FRACUNIT, ALLOW_REPLACE); + mo = Spawn ("PoisonBag", Owner->Vec3Offset( + 16*finecosine[angle], + 24*finesine[angle], + -Owner->floorclip+8*FRACUNIT), ALLOW_REPLACE); if (mo) { mo->target = Owner; @@ -79,10 +79,10 @@ bool AArtiPoisonBag2::Use (bool pickup) angle_t angle = Owner->angle >> ANGLETOFINESHIFT; AActor *mo; - mo = Spawn ("FireBomb", - Owner->x+16*finecosine[angle], - Owner->y+24*finesine[angle], Owner->z- - Owner->floorclip+8*FRACUNIT, ALLOW_REPLACE); + mo = Spawn ("FireBomb", Owner->Vec3Offset( + 16*finecosine[angle], + 24*finesine[angle], + -Owner->floorclip+8*FRACUNIT), ALLOW_REPLACE); if (mo) { mo->target = Owner; @@ -106,8 +106,7 @@ bool AArtiPoisonBag3::Use (bool pickup) { AActor *mo; - mo = Spawn("ThrowingBomb", Owner->x, Owner->y, - Owner->z-Owner->floorclip+35*FRACUNIT + (Owner->player? Owner->player->crouchoffset : 0), ALLOW_REPLACE); + mo = Spawn("ThrowingBomb", Owner->PosPlusZ(-Owner->floorclip+35*FRACUNIT + (Owner->player? Owner->player->crouchoffset : 0)), ALLOW_REPLACE); if (mo) { mo->angle = Owner->angle + (((pr_poisonbag()&7) - 4) << 24); @@ -133,7 +132,7 @@ bool AArtiPoisonBag3::Use (bool pickup) mo->velz = FixedMul(speed, finesine[modpitch]); mo->velx = FixedMul(xyscale, finecosine[angle]) + (Owner->velx >> 1); mo->vely = FixedMul(xyscale, finesine[angle]) + (Owner->vely >> 1); - mo->z += FixedMul(mo->Speed, finesine[orgpitch]); + mo->SetZ(mo->Z() + FixedMul(mo->Speed, finesine[orgpitch])); mo->target = Owner; mo->tics -= pr_poisonbag()&3; @@ -159,7 +158,7 @@ bool AArtiPoisonBagGiver::Use (bool pickup) const PClass *MissileType = PClass::FindClass((ENamedName) this->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None)); if (MissileType != NULL) { - AActor *mo = Spawn (MissileType, Owner->x, Owner->y, Owner->z, ALLOW_REPLACE); + AActor *mo = Spawn (MissileType, Owner->Pos(), ALLOW_REPLACE); if (mo != NULL) { if (mo->IsKindOf(RUNTIME_CLASS(AInventory))) @@ -385,7 +384,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagInit) { AActor *mo; - mo = Spawn (self->x, self->y, self->z+28*FRACUNIT, ALLOW_REPLACE); + mo = Spawn (self->PosPlusZ(28*FRACUNIT), ALLOW_REPLACE); if (mo) { mo->target = self->target; @@ -422,7 +421,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagDamage) P_RadiusAttack (self, self->target, 4, 40, self->DamageType, RADF_HURTSOURCE); bobIndex = self->special2; - self->z += finesine[bobIndex << BOBTOFINESHIFT] >> 1; + self->SetZ(self->Z() + finesine[bobIndex << BOBTOFINESHIFT] >> 1); self->special2 = (bobIndex + 1) & 63; } @@ -456,7 +455,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2) < (3*3)/(2*2)) { self->SetState (self->SpawnState + 6); - self->z = self->floorz; + self->SetZ(self->floorz); self->velz = 0; self->BounceFlags = BOUNCE_None; self->flags &= ~MF_MISSILE;