Skip to content

Commit

Permalink
LineDef: updateSlopeType() miscalculated the direction vector
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Apr 12, 2013
1 parent 72d96b7 commit 9731f58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/src/map/linedef.cpp
Expand Up @@ -264,7 +264,7 @@ slopetype_t LineDef::slopeType() const

void LineDef::updateSlopeType()
{
d->direction = d->to->origin() - d->from->origin();
d->direction = Vector2d(d->to->origin()) - Vector2d(d->from->origin());
d->angle = bamsAtan2(int( d->direction.y ), int( d->direction.x ));
d->slopeType = M_SlopeTypeXY(d->direction.x, d->direction.y);
}
Expand Down
7 changes: 5 additions & 2 deletions doomsday/client/src/map/sector.cpp
Expand Up @@ -365,6 +365,10 @@ void Sector::updateSoundEmitterOrigin()

void Sector::planeHeightChanged(Plane &plane, coord_t oldHeight)
{
// We are presently only interested in floor and/or ceiling height changes.
if(!(&plane == &floor() || &plane == &ceiling()))
return;

updateSoundEmitterOrigin();
#ifdef __CLIENT__
R_UpdateMissingMaterialsForLinesOfSector(*this);
Expand All @@ -382,7 +386,6 @@ void Sector::planeHeightChanged(Plane &plane, coord_t oldHeight)
if(!ddpl->inGame || !ddpl->mo || !ddpl->mo->bspLeaf)
continue;

/// @todo $nplanes
if((ddpl->flags & DDPF_CAMERA) && ddpl->mo->bspLeaf->sectorPtr() == this &&
(ddpl->mo->origin[VZ] > ceiling().height() - 4 || ddpl->mo->origin[VZ] < floor().height()))
{
Expand Down Expand Up @@ -421,7 +424,7 @@ void Sector::planeHeightChanged(Plane &plane, coord_t oldHeight)

#endif // __CLIENT__

DENG2_UNUSED2(plane, oldHeight);
DENG2_UNUSED(oldHeight);
}

int Sector::property(setargs_t &args) const
Expand Down

0 comments on commit 9731f58

Please sign in to comment.