Terrain: stream the 3x3 blocks around the player

CMapOutdoor keeps the 3x3 terrain blocks around the player loaded and
reloads them on a block change; we loaded only the warp block, so the
map ended at its edge. Stitch the set into one TerrainHeightmap, fix the
attr.atr cell mapping, and reload terrain, areadata and water per block
from CPythonBackground::Update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-13 12:38:11 +09:00
co-authored by Claude Opus 5.5
parent 29f33b289a
commit 47e867252f
8 changed files with 280 additions and 99 deletions
+5
View File
@@ -167,6 +167,11 @@ int main(int argc, char** argv) {
"assert bg.IsAttrOn(0, 0, bg.ATTR_BLOCK) == 1\n"
"bg.WarpTest(1284, 2308)\n"
"assert bg.GetHeight(26000.0, 26000.0) == 209.0, bg.GetHeight(26000.0, 26000.0)\n"
"assert bg.GetHeight(0.0, 0.0) == 100.0, bg.GetHeight(0.0, 0.0)\n"
"assert bg.IsAttrOn(0, 0, bg.ATTR_BLOCK) == 1\n"
"assert bg.IsAttrOn(26000, 26000, bg.ATTR_BLOCK) == 0\n"
"bg.Update(400.0, 400.0, 0.0)\n"
"assert bg.GetHeight(26000.0, 26000.0) == 209.0, bg.GetHeight(26000.0, 26000.0)\n"
"\n"
"bg.Destroy()\n"
"assert bg.GetCurrentMapName() == ''\n"