mirror of https://github.com/AxioDL/metaforce.git
Decomp fix for CScriptEMPulse
This commit is contained in:
parent
18a76edf1a
commit
0cd4794059
|
@ -78,17 +78,18 @@ void CScriptEMPulse::Touch(CActor& act, CStateManager& mgr) {
|
||||||
|
|
||||||
if (const TCastToPtr<CPlayer> pl = act) {
|
if (const TCastToPtr<CPlayer> pl = act) {
|
||||||
const zeus::CVector3f posDiff = GetTranslation() - pl->GetTranslation();
|
const zeus::CVector3f posDiff = GetTranslation() - pl->GetTranslation();
|
||||||
if (posDiff.magnitude() < xec_finalRadius) {
|
const float diffMagnitude = posDiff.magnitude();
|
||||||
const float dur =
|
if (diffMagnitude < xec_finalRadius) {
|
||||||
((1.f - (posDiff.magnitude() / xec_finalRadius)) * (xfc_ - xf8_interferenceDur)) + xf8_interferenceDur;
|
const float multi = 1.f - (diffMagnitude / xec_finalRadius);
|
||||||
const float mag =
|
const float dur = (multi * (xfc_ - xf8_interferenceDur)) + xf8_interferenceDur;
|
||||||
((1.f - (posDiff.magnitude() / xec_finalRadius)) * (x104_ - xf8_interferenceDur)) + x100_interferenceMag;
|
const float mag = (multi * (x104_ - x100_interferenceMag)) + x100_interferenceMag;
|
||||||
|
|
||||||
if (dur > pl->GetStaticTimer()) {
|
if (dur > pl->GetStaticTimer()) {
|
||||||
pl->SetHudDisable(dur, 0.5f, 2.5f);
|
pl->SetHudDisable(dur, 0.5f, 2.5f);
|
||||||
} else {
|
pl->SetOrbitRequestForTarget(mgr.GetPlayer().GetOrbitTargetId(),
|
||||||
mgr.GetPlayerState()->GetStaticInterference().AddSource(GetUniqueId(), mag, dur);
|
CPlayer::EPlayerOrbitRequest::ActivateOrbitSource, mgr);
|
||||||
}
|
}
|
||||||
|
mgr.GetPlayerState()->GetStaticInterference().AddSource(GetUniqueId(), mag, dur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue