diff --git a/source/core/rendering/scene/hw_bunchdrawer.cpp b/source/core/rendering/scene/hw_bunchdrawer.cpp index 50ef2995a..b81b9c0ef 100644 --- a/source/core/rendering/scene/hw_bunchdrawer.cpp +++ b/source/core/rendering/scene/hw_bunchdrawer.cpp @@ -275,10 +275,13 @@ int BunchDrawer::ClipLine(int aline, bool portal) void BunchDrawer::ProcessBunch(int bnch) { FBunch* bunch = &Bunches[bnch]; + int start = bunch->startline; + int end = bunch->endline; ClipWall.Clock(); - for (int i = bunch->startline; i <= bunch->endline; i++) + for (int i = start; i <= end; i++) { + bunch = &Bunches[bnch]; // re-get the pointer in case of reallocation. int clipped = ClipLine(i, bunch->portal); if (clipped & CL_Draw)