From 81859374cebe6107b60780d4dbb56b43035efec1 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 20:38:52 +0000 Subject: [PATCH] Decompile fn_17681 (WorldSpatialTree::ReadBounds) Batch #11167 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_17681 WorldSpatialTree::ReadBounds: logic confirmed by peer review Peer-reviewed-by: kyoshi, dori, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/World/WorldSpatialTree.cpp | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Source/Contents/World/WorldSpatialTree.cpp b/Source/Contents/World/WorldSpatialTree.cpp index f32acbb5..2779ff83 100644 --- a/Source/Contents/World/WorldSpatialTree.cpp +++ b/Source/Contents/World/WorldSpatialTree.cpp @@ -41,6 +41,11 @@ CWorld::~CWorld() { // OFFSET: 0x00AC66F0 // FUNCTION: fn_17652 WorldSpatialTree::WorldSpatialTree() : parent(nullptr), children{}, minimum{}, maximum{}, center{}, halfSize{}, dirty(1) { + this->parent = nullptr; + for (unsigned index = 0; index < 4; ++index) { + this->children[index] = nullptr; + } + this->dirty = 1; } // OFFSET: 0x00AC71E0 @@ -106,25 +111,25 @@ void WorldSpatialTree::Subdivide(int depth) { // OFFSET: 0x00AC8F60 // FUNCTION: fn_17681 void WorldSpatialTree::ReadBounds(CFile& input, int depth) { - for (float& value : this->maximum) { - input.Read(&value, sizeof(value)); + for (unsigned index = 0; index < 3; ++index) { + input.Read(&this->maximum[index], sizeof(float)); } - for (float& value : this->minimum) { - input.Read(&value, sizeof(value)); + for (unsigned index = 0; index < 3; ++index) { + input.Read(&this->minimum[index], sizeof(float)); } - for (float& value : this->halfSize) { - input.Read(&value, sizeof(value)); + for (unsigned index = 0; index < 3; ++index) { + input.Read(&this->halfSize[index], sizeof(float)); } - for (float& value : this->center) { - input.Read(&value, sizeof(value)); + for (unsigned index = 0; index < 3; ++index) { + input.Read(&this->center[index], sizeof(float)); } if (depth != 5) { - for (WorldSpatialTree* child : this->children) { - child->ReadBounds(input, depth + 1); + for (unsigned index = 0; index < 4; ++index) { + this->children[index]->ReadBounds(input, depth + 1); } } }