Merge branch 'master' into float

# Conflicts:
#	src/g_heretic/a_hereticweaps.cpp
#	src/p_map.cpp
#	src/p_mobj.cpp
#	src/p_things.cpp
#	src/portal.cpp
This commit is contained in:
Christoph Oelckers 2016-03-15 00:16:13 +01:00
commit c64eee5b15
104 changed files with 1206 additions and 1073 deletions

View file

@ -274,12 +274,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
int numChunks;
AActor *mo;
if ((self->velx || self->vely || self->velz) && !(self->flags6 & MF6_SHATTERING))
if ((self->vel.x || self->vel.y || self->vel.z) && !(self->flags6 & MF6_SHATTERING))
{
self->tics = 3*TICRATE;
return 0;
}
self->velx = self->vely = self->velz = 0;
self->vel.x = self->vel.y = self->vel.z = 0;
S_Sound (self, CHAN_BODY, "misc/icebreak", 1, ATTN_NORM);
// [RH] In Hexen, this creates a random number of shards (range [24,56])
@ -298,9 +298,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
if (mo)
{
mo->SetState (mo->SpawnState + (pr_freeze()%3));
mo->velz = FixedDiv(mo->Z() - self->Z(), self->height)<<2;
mo->velx = pr_freeze.Random2 () << (FRACBITS-7);
mo->vely = pr_freeze.Random2 () << (FRACBITS-7);
mo->vel.z = FixedDiv(mo->Z() - self->Z(), self->height)<<2;
mo->vel.x = pr_freeze.Random2 () << (FRACBITS-7);
mo->vel.y = pr_freeze.Random2 () << (FRACBITS-7);
CALL_ACTION(A_IceSetTics, mo); // set a random tic wait
mo->RenderStyle = self->RenderStyle;
mo->alpha = self->alpha;
@ -311,9 +311,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
AActor *head = Spawn("IceChunkHead", self->PosPlusZ(self->player->mo->ViewHeight), ALLOW_REPLACE);
if (head != NULL)
{
head->velz = FixedDiv(head->Z() - self->Z(), self->height)<<2;
head->velx = pr_freeze.Random2 () << (FRACBITS-7);
head->vely = pr_freeze.Random2 () << (FRACBITS-7);
head->vel.z = FixedDiv(head->Z() - self->Z(), self->height)<<2;
head->vel.x = pr_freeze.Random2 () << (FRACBITS-7);
head->vel.y = pr_freeze.Random2 () << (FRACBITS-7);
head->health = self->health;
head->angle = self->angle;
if (head->IsKindOf(RUNTIME_CLASS(APlayerPawn)))

View file

@ -981,9 +981,9 @@ void APowerFlight::InitEffect ()
Owner->flags |= MF_NOGRAVITY;
if (Owner->Z() <= Owner->floorz)
{
Owner->velz = 4*FRACUNIT; // thrust the player in the air a bit
Owner->vel.z = 4*FRACUNIT; // thrust the player in the air a bit
}
if (Owner->velz <= -35*FRACUNIT)
if (Owner->vel.z <= -35*FRACUNIT)
{ // stop falling scream
S_StopSound (Owner, CHAN_VOICE);
}
@ -1261,7 +1261,7 @@ void APowerSpeed::DoEffect ()
}
}
if (P_AproxDistance (Owner->velx, Owner->vely) <= 12*FRACUNIT)
if (P_AproxDistance (Owner->vel.x, Owner->vel.y) <= 12*FRACUNIT)
return;
AActor *speedMo = Spawn<APlayerSpeedTrail> (Owner->Pos(), NO_REPLACE);

View file

@ -15,7 +15,7 @@ public:
{
if (!Super::FloorBounceMissile (plane))
{
if (abs (velz) < (FRACUNIT/2))
if (abs (vel.z) < (FRACUNIT/2))
{
Destroy ();
}
@ -45,7 +45,7 @@ void P_SpawnDirt (AActor *actor, fixed_t radius)
mo = Spawn (dtype, pos, ALLOW_REPLACE);
if (mo)
{
mo->velz = pr_dirt()<<10;
mo->vel.z = pr_dirt()<<10;
}
}
}

View file

@ -47,7 +47,7 @@ void AFastProjectile::Tick ()
int count = 8;
if (radius > 0)
{
while ( ((abs(velx) >> shift) > radius) || ((abs(vely) >> shift) > radius))
while ( ((abs(vel.x) >> shift) > radius) || ((abs(vel.y) >> shift) > radius))
{
// we need to take smaller steps.
shift++;
@ -56,11 +56,11 @@ void AFastProjectile::Tick ()
}
// Handle movement
if (velx || vely || (Z() != floorz) || velz)
if (vel.x || vel.y || (Z() != floorz) || vel.z)
{
xfrac = velx >> shift;
yfrac = vely >> shift;
zfrac = velz >> shift;
xfrac = vel.x >> shift;
yfrac = vel.y >> shift;
zfrac = vel.z >> shift;
changexy = xfrac || yfrac;
int ripcount = count >> 3;
for (i = 0; i < count; i++)

View file

@ -120,7 +120,7 @@ bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntyp
p->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog);
p->health = morphed->health;
p->mo = morphed;
p->velx = p->vely = 0;
p->vel.x = p->vel.y = 0;
morphed->ObtainInventory (actor);
// Remove all armor
for (item = morphed->Inventory; item != NULL; )
@ -227,11 +227,11 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag,
mo->player = player;
mo->reactiontime = 18;
mo->flags = ActorFlags::FromInt (pmo->special2) & ~MF_JUSTHIT;
mo->velx = 0;
mo->vely = 0;
player->velx = 0;
player->vely = 0;
mo->velz = pmo->velz;
mo->vel.x = 0;
mo->vel.y = 0;
player->vel.x = 0;
player->vel.y = 0;
mo->vel.z = pmo->vel.z;
if (!(pmo->special2 & MF_JUSTHIT))
{
mo->renderflags &= ~RF_INVISIBLE;
@ -461,9 +461,9 @@ bool P_UndoMonsterMorph (AMorphedMonster *beast, bool force)
if (!(beast->FlagsSave & MF_JUSTHIT))
actor->renderflags &= ~RF_INVISIBLE;
actor->health = actor->SpawnHealth();
actor->velx = beast->velx;
actor->vely = beast->vely;
actor->velz = beast->velz;
actor->vel.x = beast->vel.x;
actor->vel.y = beast->vel.y;
actor->vel.z = beast->vel.z;
actor->tid = beast->tid;
actor->special = beast->special;
actor->Score = beast->Score;

View file

@ -150,8 +150,8 @@ void DEarthquake::Tick ()
an >>= ANGLETOFINESHIFT;
// So this is actually completely wrong, but it ought to be good
// enough. Otherwise, I'd have to use tangents and square roots.
victim->velx += FixedMul(m_IntensityX << (FRACBITS-1), finecosine[an]);
victim->vely += FixedMul(m_IntensityY << (FRACBITS-1), finesine[an]);
victim->vel.x += FixedMul(m_IntensityX << (FRACBITS-1), finecosine[an]);
victim->vel.y += FixedMul(m_IntensityY << (FRACBITS-1), finesine[an]);
}
}
}

View file

@ -175,9 +175,9 @@ class ARandomSpawner : public AActor
newmobj->SpawnFlags = SpawnFlags;
newmobj->tid = tid;
newmobj->AddToHash();
newmobj->velx = velx;
newmobj->vely = vely;
newmobj->velz = velz;
newmobj->vel.x = vel.x;
newmobj->vel.y = vel.y;
newmobj->vel.z = vel.z;
newmobj->master = master; // For things such as DamageMaster/DamageChildren, transfer mastery.
newmobj->target = target;
newmobj->tracer = tracer;