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).
This commit is contained in:
ragnarok-clanker 2026-11-05 16:08:19 +00:00
commit d916d6c4e1

View file

@ -84,16 +84,18 @@ float CooldownState::Update() {
this->angle = 90.0f - (this->angle - static_cast<float>(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<float>(std::tan(static_cast<double>(radians)));
const float distance = static_cast<float>(edge.radius) / tangent;
edge.current = edge.increasing != 0 ? edge.origin + distance : edge.origin - distance;
if (edge.increasing != 0) {
edge.current = edge.origin + static_cast<float>(edge.radius) / tangent;
} else {
edge.current = edge.origin - static_cast<float>(edge.radius) / tangent;
}
return edge.current;
}