From 3f9b790c6ea5b615191ad467b2871e9047431da3 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 16:01:26 +0000 Subject: [PATCH] Decompile fn_17493 (C3dActorV1::Update) Batch #12405 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_17493 C3dActorV1::Update: logic confirmed by peer review Peer-reviewed-by: Yommy, dori, codeplay Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Models/ModelPlayback.cpp | 48 +++++++++++++++--------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/Source/Contents/Models/ModelPlayback.cpp b/Source/Contents/Models/ModelPlayback.cpp index 0e893045..e69b8029 100644 --- a/Source/Contents/Models/ModelPlayback.cpp +++ b/Source/Contents/Models/ModelPlayback.cpp @@ -17,24 +17,38 @@ namespace { // OFFSET: 0x00AB7930 // FUNCTION: fn_17493 void C3dActorV1::Update() { - if (this->playback != 1 && this->playback != 2) { - return; + switch (this->playback) { + case 1: { + const unsigned tick = GetTickCount(); + if (tick == this->lastTick) { + return; + } + + this->frame = static_cast(this->speed * 100.0f + static_cast(this->frame)); + if (this->frame >= this->animationLength) { + this->frame = this->animationLength - 1; + } + + this->Animate(static_cast(this->frame)); + this->lastTick = tick; + break; + } + case 2: { + const unsigned tick = GetTickCount(); + if (tick == this->lastTick) { + return; + } + + this->frame = static_cast(this->speed * 100.0f + static_cast(this->frame)); + if (this->frame >= this->animationLength) { + this->frame = 0; + } + + this->Animate(static_cast(this->frame)); + this->lastTick = tick; + break; + } } - - const unsigned tick = GetTickCount(); - - if (tick == this->lastTick) { - return; - } - - this->frame = TruncateToInt(this->speed * 100.0f + static_cast(this->frame)); - - if (this->frame >= this->animationLength) { - this->frame = this->playback == 1 ? this->animationLength - 1 : 0; - } - - this->Animate(static_cast(this->frame)); - this->lastTick = tick; } // OFFSET: 0x00AB7A10