Decomp fix for CScriptEMPulse

This commit is contained in:
Henrique Gemignani Passos Lima 2022-11-14 03:05:45 +02:00
parent 18a76edf1a
commit 0cd4794059
No known key found for this signature in database
GPG Key ID: E224F951761145F8
1 changed files with 8 additions and 7 deletions

View File

@ -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);
} }
} }
} }