From 49a7f863b8b96b0c50f33c1124d6d39b235b64ba Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 24 Jun 2019 22:59:34 +0000 Subject: [PATCH] Fix off-by-1 in Group::Remap. This was introduced in bd84bc1a and caused crashes with: Assertion failed: hm.v != t->h.v. --- src/group.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/group.cpp b/src/group.cpp index 5524814..5e7dc58 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -718,7 +718,7 @@ hEntity Group::Remap(hEntity in, int copyNumber) { auto it = remap.find({ in, copyNumber }); if(it == remap.end()) { std::tie(it, std::ignore) = - remap.insert({ { in, copyNumber }, { (uint32_t)remap.size() } }); + remap.insert({ { in, copyNumber }, { (uint32_t)remap.size() + 1 } }); } return h.entity(it->second.v); }