From 330920daa8df5e8294f5e2982de94eb8d2835f36 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Thu, 9 Apr 2015 21:41:46 +1000 Subject: [PATCH] Fix off by one error(s). --- apps/opencs/model/world/idadapterimp.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/opencs/model/world/idadapterimp.hpp b/apps/opencs/model/world/idadapterimp.hpp index aed847909..510a14f12 100644 --- a/apps/opencs/model/world/idadapterimp.hpp +++ b/apps/opencs/model/world/idadapterimp.hpp @@ -36,9 +36,9 @@ namespace CSMWorld std::vector::iterator iter = pathgrid.mEdges.begin(); for (;iter != pathgrid.mEdges.end(); ++iter) { - if ((*iter).mV0 > position) + if ((*iter).mV0 >= position) (*iter).mV0++; - if ((*iter).mV1 > position) + if ((*iter).mV1 >= position) (*iter).mV1++; } @@ -65,10 +65,10 @@ namespace CSMWorld if (((*iter).mV0 == rowToRemove) || ((*iter).mV1 == rowToRemove)) pathgrid.mEdges.erase(iter); - if ((*iter).mV0 > rowToRemove) + if ((*iter).mV0 >= rowToRemove) (*iter).mV0--; - if ((*iter).mV1 > rowToRemove) + if ((*iter).mV1 >= rowToRemove) (*iter).mV1--; }