From de951b99da775243edc4637dd8420efe67309861 Mon Sep 17 00:00:00 2001 From: mityada Date: Sun, 6 Nov 2016 19:50:14 +0000 Subject: [PATCH] Fix typo in VMap BIH generation Due to this typo some objects could be left out during BIH generation and thus never checked for intersection. This breaks height and LoS calculations in some areas. This occurrence of this bug can be seen in "Md_Mushroomcave.wmo". It can be found in several locations, for example (-6140, -2960, 400), map 0. In some parts of the cave mobs will either fall through the ground or fly up into the sky when chasing the player. LoS is not obstructed there as well. P.S. This typo presents in all MaNGOS cores. --- src/game/vmap/BIH.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/vmap/BIH.cpp b/src/game/vmap/BIH.cpp index ab8496ff9..082cbb2f2 100644 --- a/src/game/vmap/BIH.cpp +++ b/src/game/vmap/BIH.cpp @@ -157,8 +157,8 @@ void BIH::subdivide(int left, int right, std::vector& tempTree, buildDat if (prevAxis == axis && G3D::fuzzyEq(prevSplit, split)) { // we are stuck here - create a leaf - stats.updateLeaf(depth, right - left + 1); - createNode(tempTree, nodeIndex, left, right); + stats.updateLeaf(depth, rightOrig - left + 1); + createNode(tempTree, nodeIndex, left, rightOrig); return; } right = rightOrig;