From 610879684dda1fe0cbb411ce3f76b71dfd222e34 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 04:19:31 +0000 Subject: [PATCH] Decompile fn_04817 (SpriteLayerRenderer::DrawLayer) Batch #17836 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_04817 SpriteLayerRenderer::DrawLayer: logic confirmed by peer review Peer-reviewed-by: Yommy, alisonrag, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Sprites/SpriteLayerDrawing.cpp | 7 ++++++- Source/Contents/Sprites/SpriteLayerDrawing.h | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/Contents/Sprites/SpriteLayerDrawing.cpp b/Source/Contents/Sprites/SpriteLayerDrawing.cpp index 8be7ee8ae..d13b02180 100644 --- a/Source/Contents/Sprites/SpriteLayerDrawing.cpp +++ b/Source/Contents/Sprites/SpriteLayerDrawing.cpp @@ -596,7 +596,12 @@ std::pair SpriteLayerRenderer::GetLayerSound(int layer, CActR void SpriteLayerRenderer::DrawLayer( int index, int layer, const ActionFrame* frame, CSprRes* sprite, CActRes* action, int animation, int frameIndex, bool replaced ) { - int cellIndex = GetSlotLayer(g_session.IsSpecialMonsterJob(this->layerViews[layer]) ? 1 : layer); + int cellIndex; + if (g_session.IsSpecialMonsterJob(this->layerViews[layer])) { + cellIndex = GetSlotLayer(1); + } else { + cellIndex = GetSlotLayer(layer); + } for (int i = 0; i < frame->cellCount; ++i) { if (layer == 7) { cellIndex = i; diff --git a/Source/Contents/Sprites/SpriteLayerDrawing.h b/Source/Contents/Sprites/SpriteLayerDrawing.h index 13a67c070..cae46a981 100644 --- a/Source/Contents/Sprites/SpriteLayerDrawing.h +++ b/Source/Contents/Sprites/SpriteLayerDrawing.h @@ -20,8 +20,8 @@ struct SpriteFrameCell; struct SpriteRleImage; struct SpriteLayerResources { - /* 0000 */ CSprRes* sprite; - /* 0004 */ CActRes* action; + /* 0000 */ CSprRes* sprite = nullptr; + /* 0004 */ CActRes* action = nullptr; }; struct SpriteLayerCell {