From d916d6c4e105bbad2cb677a57f7968c632c56ae3 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 16:08:19 +0000 Subject: [PATCH] Decompile fn_20948 (CooldownState::Update) Batch #12331 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_20948 CooldownState::Update: logic confirmed by peer review Peer-reviewed-by: Yommy, gordaoprogramas, Tanke, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Cooldowns/CooldownState.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/UI/Cooldowns/CooldownState.cpp b/Source/UI/Cooldowns/CooldownState.cpp index 5e3f25d3..549ad815 100644 --- a/Source/UI/Cooldowns/CooldownState.cpp +++ b/Source/UI/Cooldowns/CooldownState.cpp @@ -84,16 +84,18 @@ float CooldownState::Update() { this->angle = 90.0f - (this->angle - static_cast(this->segment) * 45.0f); } - auto entry = this->edges.find(this->segment); - CooldownEdge& edge = entry->second; if (this->duration <= progress) { - return edge.origin; + return this->edges.find(this->segment)->second.origin; } + CooldownEdge& edge = this->edges.find(this->segment)->second; const float radians = this->angle * 0.017453292f; const float tangent = static_cast(std::tan(static_cast(radians))); - const float distance = static_cast(edge.radius) / tangent; - edge.current = edge.increasing != 0 ? edge.origin + distance : edge.origin - distance; + if (edge.increasing != 0) { + edge.current = edge.origin + static_cast(edge.radius) / tangent; + } else { + edge.current = edge.origin - static_cast(edge.radius) / tangent; + } return edge.current; }