From 9ec9f42457f32ce16bdd4316a0a999dce3fcf7e3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 23 Apr 2020 07:19:41 -0400 Subject: [PATCH] CPathFindSearch: Eliminate variable shadowing --- Runtime/World/CPathFindSearch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/World/CPathFindSearch.cpp b/Runtime/World/CPathFindSearch.cpp index 3cdb5dab2..65620edde 100644 --- a/Runtime/World/CPathFindSearch.cpp +++ b/Runtime/World/CPathFindSearch.cpp @@ -315,8 +315,8 @@ bool CPathFindSearch::Search(rstl::reserved_vector& regs1, const } else { /* Compute next heuristic */ x0_area->ClosedSet().Rmv(linkReg->GetIndex()); - float h = (p2 - linkReg->GetCentroid()).magnitude(); - linkReg->Data()->Setup(reg, g, h); + const float nextHeuristic = (p2 - linkReg->GetCentroid()).magnitude(); + linkReg->Data()->Setup(reg, g, nextHeuristic); } /* Make next potential candidate */