Decompile fn_03160 (CSkillAction_Direction::SpawnDirectionalEffect)

Batch #5555 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_03160 CSkillAction_Direction::SpawnDirectionalEffect: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, willerthal
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-10-30 13:09:26 +00:00
commit 2285a5fb67

View file

@ -460,6 +460,22 @@ void CSkillAction_ThunderingExpand::Slot17(CGameActor* source) {
}
// OFFSET: 0x005A5AC0
// FUNCTION: fn_03160
void CSkillAction_Direction::SpawnDirectionalEffect(CGameActor* source, CGameActor* target, std::string_view name) {
const float angle = ScreenAngle(
&source->render.position.x, &target->render.position.x, static_cast<CGameMode*>(g_modeMgr.GetGameMode())->camera->frame.view.values
);
const int direction = this->GetDirection(angle);
if (!this->IsValidDirection(direction)) {
return;
}
const bool flipped = direction == 1 || direction == 2;
if (CEffect* effect = g_effectMgr->Spawn(target->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId(name.data()), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0)) {
effect->Slot26(flipped);
effect->Slot17(static_cast<float>((static_cast<int>(angle + (flipped ? -180.0f : 0.0f)) + 360) % 360));
}
}
// OFFSET: 0x005A5D20
// FUNCTION: fn_03161