From 1d202dc5b1fccd5131e95dd227521328ae30fd82 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 3 Jul 2024 23:16:36 +0200 Subject: [PATCH] Recast: fix reachability table data truncation Value should be multiplied by size of int. --- src/naveditor/GameUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/naveditor/GameUtils.cpp b/src/naveditor/GameUtils.cpp index b7366bf3..d34f233c 100644 --- a/src/naveditor/GameUtils.cpp +++ b/src/naveditor/GameUtils.cpp @@ -172,7 +172,7 @@ int buildLinkTable(dtNavMesh* mesh, LinkTableData& data) } } - return (data.setCount-1) * ((data.setCount + 31) / 32) + (data.setCount-1) / 32; + return sizeof(int)*(data.setCount-1) * ((data.setCount + 31) / 32) + (data.setCount-1) / 32; } void setReachable(std::vector& data, int count, int id1, int id2, bool value) {