From e7b32e79697752f0f32f3bb390750883163ea7dd Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 11:42:43 +0000 Subject: [PATCH] Decompile fn_21286 (CGameMode::MarkWorldOcclusion) Batch #18125 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_21286 CGameMode::MarkWorldOcclusion: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, alisonrag, bibinir Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/World/WorldOcclusion.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/Contents/World/WorldOcclusion.cpp b/Source/Contents/World/WorldOcclusion.cpp index a62299ed7..154679b66 100644 --- a/Source/Contents/World/WorldOcclusion.cpp +++ b/Source/Contents/World/WorldOcclusion.cpp @@ -24,18 +24,24 @@ void CGameMode::MarkWorldOcclusion() { g_renderer->viewport.Ray(screenX, screenY, this->camera->frame.eye, this->camera->frame.inverse.values, ray); float actorRay[7]; - std::memcpy(actorRay, ray, sizeof(ray)); + actorRay[0] = ray[0]; + actorRay[1] = ray[1]; + actorRay[2] = ray[2]; + actorRay[3] = ray[3]; + actorRay[4] = ray[4]; + actorRay[5] = ray[5]; actorRay[6] = (this->scene->player->render.position.y + this->camera->camera.distance) - 16.0f; query.Collect(ray, &this->scene->spatial); - for (WorldSpatialTree* node : query.nodes) { - for (C3dActor* model : node->objects) { - model->MarkOccluded(actorRay); + for (auto node = query.nodes.begin(); node != query.nodes.end(); ++node) { + for (auto model = (*node)->objects.begin(); model != (*node)->objects.end(); ++model) { + (*model)->MarkOccluded(actorRay); } } if (this->checkGroundAlpha) { - for (WorldSpatialTree* node : query.nodes) { + for (auto it = query.nodes.begin(); it != query.nodes.end(); ++it) { + WorldSpatialTree* node = *it; int row = node->groundCells[1]; while (row <= node->groundCells[3]) {