- Changed gravity doubling so that it only happens when you run off a ledge.

SVN r1543 (trunk)
This commit is contained in:
Randy Heit 2009-04-14 01:20:44 +00:00
parent 6a9acc2cf8
commit 81c4773b46
2 changed files with 44 additions and 23 deletions

View File

@ -1,4 +1,7 @@
April 10, 2009
April 13, 2009
- Changed gravity doubling so that it only happens when you run off a ledge.
April 10, 2009
- Fixed: World panning was ignored for the X offset of masked midtextures.
April 10, 2009 (Changes by Graf Zahl)

View File

@ -1328,13 +1328,15 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax)
}
//
// P_XYMovement
// P_XYMovement
//
// Returns the actor's old floorz.
//
#define STOPSPEED 0x1000
#define FRICTION 0xe800
#define CARRYSTOPSPEED (STOPSPEED*32/3)
void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
{
bool bForceSlide = scrollx || scrolly;
angle_t angle;
@ -1345,6 +1347,7 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
static const int windTab[3] = {2048*5, 2048*10, 2048*25};
int steps, step, totalsteps;
fixed_t startx, starty;
fixed_t oldfloorz = mo->floorz;
fixed_t maxmove = (mo->waterlevel < 1) || (mo->flags & MF_MISSILE) ||
(mo->player && mo->player->crouchoffset<-10*FRACUNIT) ? MAXMOVE : MAXMOVE/4;
@ -1430,7 +1433,7 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
mo->tics = -1;
}
}
return;
return oldfloorz;
}
player = mo->player;
@ -1613,12 +1616,12 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
{
S_Sound (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_IDLE);
}
return;
return oldfloorz;
}
else
{ // Struck a player/creature
P_ExplodeMissile (mo, NULL, BlockingMobj);
return;
return oldfloorz;
}
}
}
@ -1631,7 +1634,7 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
{
S_Sound (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_IDLE);
}
return;
return oldfloorz;
}
}
if (BlockingMobj &&
@ -1658,7 +1661,7 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
mo->tracer = mo->target;
}
mo->target = BlockingMobj;
return;
return oldfloorz;
}
explode:
// explode a missile
@ -1671,16 +1674,16 @@ explode:
// Hack to prevent missiles exploding against the sky.
// Does not handle sky floors.
mo->Destroy ();
return;
return oldfloorz;
}
// [RH] Don't explode on horizon lines.
if (mo->BlockingLine != NULL && mo->BlockingLine->special == Line_Horizon)
{
mo->Destroy ();
return;
return oldfloorz;
}
P_ExplodeMissile (mo, mo->BlockingLine, BlockingMobj);
return;
return oldfloorz;
}
else
{
@ -1715,12 +1718,12 @@ explode:
{ // debug option for no sliding at all
mo->momx = mo->momy = 0;
player->momx = player->momy = 0;
return;
return oldfloorz;
}
if (mo->flags & (MF_MISSILE | MF_SKULLFLY))
{ // no friction for missiles
return;
return oldfloorz;
}
if (mo->z > mo->floorz && !(mo->flags2 & MF2_ONMOBJ) &&
@ -1737,7 +1740,7 @@ explode:
player->momy = FixedMul (player->momy, level.airfriction);
}
}
return;
return oldfloorz;
}
if (mo->flags & MF_CORPSE)
@ -1761,7 +1764,7 @@ explode:
}
if (i==mo->Sector->e->XFloor.ffloors.Size())
#endif
return;
return oldfloorz;
}
}
}
@ -1820,6 +1823,7 @@ explode:
player->momy = FixedMul (player->momy, ORIG_FRICTION);
}
}
return oldfloorz;
}
// Move this to p_inter ***
@ -1849,7 +1853,7 @@ void P_MonsterFallingDamage (AActor *mo)
//
// P_ZMovement
//
void P_ZMovement (AActor *mo)
void P_ZMovement (AActor *mo, fixed_t oldfloorz)
{
fixed_t dist;
fixed_t delta;
@ -1864,7 +1868,10 @@ void P_ZMovement (AActor *mo)
mo->player->deltaviewheight = mo->player->GetDeltaViewHeight();
}
if (!(mo->flags2&MF2_FLOATBOB)) mo->z += mo->momz;
if (!(mo->flags2 & MF2_FLOATBOB))
{
mo->z += mo->momz;
}
//
// apply gravity
@ -1879,8 +1886,16 @@ void P_ZMovement (AActor *mo)
fixed_t grav = (fixed_t)(level.gravity * mo->Sector->gravity *
FIXED2FLOAT(mo->gravity) * 81.92);
if (mo->momz == 0) mo->momz -= grav + grav;
else mo->momz -= grav;
// [RH] Double gravity only if running off a ledge. Coming down from
// an upward thrust (e.g. a jump) should not double it.
if (mo->momz == 0 && oldfloorz > mo->floorz && mo->z == oldfloorz)
{
mo->momz -= grav + grav;
}
else
{
mo->momz -= grav;
}
}
if (mo->waterlevel > 1)
{
@ -1898,7 +1913,10 @@ void P_ZMovement (AActor *mo)
}
}
if (mo->flags2&MF2_FLOATBOB) mo->z += mo->momz;
if (mo->flags2 & MF2_FLOATBOB)
{
mo->z += mo->momz;
}
//
// adjust height
@ -2930,7 +2948,7 @@ void AActor::Tick ()
// Handle X and Y momemtums
BlockingMobj = NULL;
P_XYMovement (this, cummx, cummy);
fixed_t oldfloorz = P_XYMovement (this, cummx, cummy);
if (ObjectFlags & OF_EuthanizeMe)
{ // actor was destroyed
return;
@ -2953,7 +2971,7 @@ void AActor::Tick ()
{
if (!(onmo = P_CheckOnmobj (this)))
{
P_ZMovement (this);
P_ZMovement (this, oldfloorz);
flags2 &= ~MF2_ONMOBJ;
}
else
@ -2986,7 +3004,7 @@ void AActor::Tick ()
}
else
{
P_ZMovement (this);
P_ZMovement (this, oldfloorz);
}
if (ObjectFlags & OF_EuthanizeMe)