fix: Cleans up AI Pathfinding code to make it more portable for custom requirements. (#2474)

This commit is contained in:
Kamron Batman 2026-06-07 13:25:10 -07:00 committed by GitHub
parent 412a71dfe0
commit 30fec7da26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 198 additions and 102 deletions

View file

@ -234,9 +234,7 @@ internal static class StepCacheFile
// chunks add another ~2.5 KB (swim layer) but they're a small fraction of any
// map; the writer grows on overflow so under-estimating just causes a few
// realloc/copy cycles during the bake — not a correctness issue.
var capacity = HeaderSize
+ (BytesPerChunkBase + 256) * (int)chunkCount
+ IndexEntryBytes * (int)chunkCount;
var capacity = HeaderSize + (BytesPerChunkBase + 256) * (int)chunkCount + IndexEntryBytes * (int)chunkCount;
var buffer = new byte[capacity];
var w = new BufferWriter(buffer, prefixStr: false);