From 16d6cb99fa586ed23414c05a172ac4e93cfce599 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 23 Apr 2016 10:49:31 +0200 Subject: [PATCH] Added some Failsafe. Fixed a crash in the new game intro cinematic (when Boss of TFE die and Sam goes to the UFO) on the Pandora --- Sources/Engine/Rendering/RendASER.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) mode change 100644 => 100755 Sources/Engine/Rendering/RendASER.cpp diff --git a/Sources/Engine/Rendering/RendASER.cpp b/Sources/Engine/Rendering/RendASER.cpp old mode 100644 new mode 100755 index e5d52b0..7428a11 --- a/Sources/Engine/Rendering/RendASER.cpp +++ b/Sources/Engine/Rendering/RendASER.cpp @@ -34,7 +34,6 @@ void CRenderer::AddAddListToActiveList(INDEX iScanLine) // allocate space in destination for sum of source and add INDEX ctActiveEdges = re_aaceActiveEdges.Count(); re_aaceActiveEdgesTmp.Push(ctAddEdges+ctActiveEdges); - // check that the add list is sorted right #if ASER_EXTREME_CHECKING { @@ -66,18 +65,18 @@ void CRenderer::AddAddListToActiveList(INDEX iScanLine) // start at begining of add list, source active list and destination active list LISTITER(CAddEdge, ade_lnInAdd) itadeAdd(lhAdd); CActiveEdge *paceSrc = &re_aaceActiveEdges[0]; + CActiveEdge *paceEnd = &re_aaceActiveEdges[re_aaceActiveEdges.Count()-1]; CActiveEdge *paceDst = &re_aaceActiveEdgesTmp[0]; IFDEBUG(INDEX ctNewActive=0); IFDEBUG(INDEX ctOldActive1=0); IFDEBUG(INDEX ctOldActive2=0); - // for each edge in add list while(!itadeAdd.IsPastEnd()) { CAddEdge &ade = *itadeAdd; // while the edge in active list is left of the edge in add list - while (paceSrc->ace_xI.slHolder < itadeAdd->ade_xI.slHolder) { + while ((paceSrc->ace_xI.slHolder < ade.ade_xI.slHolder) && (paceSrc!=paceEnd)) { // copy the active edge ASSERT(paceSrc<=&re_aaceActiveEdges[ctActiveEdges-1]); *paceDst++=*paceSrc++;