From 9731f58e5f4f78ebb66864fc48853478d777f651 Mon Sep 17 00:00:00 2001 From: danij Date: Fri, 12 Apr 2013 05:07:23 +0100 Subject: [PATCH] LineDef: updateSlopeType() miscalculated the direction vector --- doomsday/client/src/map/linedef.cpp | 2 +- doomsday/client/src/map/sector.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doomsday/client/src/map/linedef.cpp b/doomsday/client/src/map/linedef.cpp index a1f1fb0941..0db4a55818 100644 --- a/doomsday/client/src/map/linedef.cpp +++ b/doomsday/client/src/map/linedef.cpp @@ -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); } diff --git a/doomsday/client/src/map/sector.cpp b/doomsday/client/src/map/sector.cpp index 40963d3cd9..3188131d32 100644 --- a/doomsday/client/src/map/sector.cpp +++ b/doomsday/client/src/map/sector.cpp @@ -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); @@ -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())) { @@ -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