From d0f03504a1c29943fb30a7dfba3cf194852e9280 Mon Sep 17 00:00:00 2001 From: danij Date: Mon, 19 Aug 2013 22:46:57 +0100 Subject: [PATCH] Fixed|World: Fatal error attempting to play icarus.wad MAP16 This map contains certain mapping constructs which we now interpret into 'extra' mesh geometries. Recently the way these geometries are constructed was changed so that segments are generated only for the edges of map lines. It appears that I mistakenly overlooked the need to update the line-of-sight algorithm accordingly (the DMU API also required an update). --- doomsday/client/src/world/api_map.cpp | 4 +++- doomsday/client/src/world/linesighttest.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doomsday/client/src/world/api_map.cpp b/doomsday/client/src/world/api_map.cpp index 364f9a557b..25477a0733 100644 --- a/doomsday/client/src/world/api_map.cpp +++ b/doomsday/client/src/world/api_map.cpp @@ -443,7 +443,9 @@ int P_Iteratep(void *elPtr, uint prop, void *context, int (*callback) (void *p, foreach(Mesh *mesh, bspLeaf->extraMeshes()) foreach(HEdge *hedge, mesh->hedges()) { - DENG_ASSERT(hedge->mapElement() != 0); // sanity check + // Is this on the back of a one-sided line? + if(!hedge->mapElement()) + continue; int result = callback(&hedge->mapElement()-> as()->line(), context); diff --git a/doomsday/client/src/world/linesighttest.cpp b/doomsday/client/src/world/linesighttest.cpp index 6d775e86d8..ace0f02a00 100644 --- a/doomsday/client/src/world/linesighttest.cpp +++ b/doomsday/client/src/world/linesighttest.cpp @@ -267,7 +267,10 @@ DENG2_PIMPL(LineSightTest) foreach(Mesh *mesh, bspLeaf.extraMeshes()) foreach(HEdge *hedge, mesh->hedges()) { - DENG_ASSERT(hedge->mapElement() != 0); // sanity check + // Is this on the back of a one-sided line? + if(!hedge->mapElement()) + continue; + if(!crossLine(hedge->mapElement()->as()->lineSide())) return false; }