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:
parent
0f057b5609
commit
d916d6c4e1
1 changed files with 7 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue