Remove slopetype from line_t.

- Recomputing it in the only two places where it's used is trivial, so
  it's basically a waste of space to precompute it.
This commit is contained in:
Randy Heit 2014-07-31 19:15:08 -05:00
commit 4cf468452c
5 changed files with 35 additions and 70 deletions

View file

@ -2244,24 +2244,8 @@ void FSlide::HitSlideLine (line_t* ld)
slidemo->z <= slidemo->floorz &&
P_GetFriction (slidemo, NULL) > ORIG_FRICTION;
if (ld->slopetype == ST_HORIZONTAL)
{
if (icyfloor && (abs(tmymove) > abs(tmxmove)))
{
tmxmove /= 2; // absorb half the velocity
tmymove = -tmymove/2;
if (slidemo->player && slidemo->health > 0 && !(slidemo->player->cheats & CF_PREDICTING))
{
S_Sound (slidemo, CHAN_VOICE, "*grunt", 1, ATTN_IDLE); // oooff!
}
}
else
tmymove = 0; // no more movement in the Y direction
return;
}
if (ld->slopetype == ST_VERTICAL)
{
if (ld->dx == 0)
{ // ST_VERTICAL
if (icyfloor && (abs(tmxmove) > abs(tmymove)))
{
tmxmove = -tmxmove/2; // absorb half the velocity
@ -2276,6 +2260,22 @@ void FSlide::HitSlideLine (line_t* ld)
return;
}
if (ld->dy == 0)
{ // ST_HORIZONTAL
if (icyfloor && (abs(tmymove) > abs(tmxmove)))
{
tmxmove /= 2; // absorb half the velocity
tmymove = -tmymove/2;
if (slidemo->player && slidemo->health > 0 && !(slidemo->player->cheats & CF_PREDICTING))
{
S_Sound (slidemo, CHAN_VOICE, "*grunt", 1, ATTN_IDLE); // oooff!
}
}
else
tmymove = 0; // no more movement in the Y direction
return;
}
// The wall is angled. Bounce if the angle of approach is // phares
// less than 45 degrees. // phares