Fix `CScriptDistanceFog::AcceptScriptMessage`

This commit is contained in:
Phillip Stephens 2020-03-08 23:18:57 -07:00
parent 7b9a037c95
commit d93df18a37
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
1 changed files with 14 additions and 15 deletions

View File

@ -46,24 +46,23 @@ void CScriptDistanceFog::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId obj
else else
fog->SetFogExplicit(x34_mode, x38_color, x3c_range); fog->SetFogExplicit(x34_mode, x38_color, x3c_range);
} else if (msg == EScriptObjectMessage::Action) { } else if (msg == EScriptObjectMessage::Action) {
if (!x61_nonZero) if (x61_nonZero) {
return;
CGameArea::CAreaFog* fog = stateMgr.GetWorld()->GetArea(x4_areaId)->GetAreaFog(); CGameArea::CAreaFog* fog = stateMgr.GetWorld()->GetArea(x4_areaId)->GetAreaFog();
if (x34_mode == ERglFogMode::None) if (x34_mode == ERglFogMode::None)
fog->RollFogOut(x48_rangeDelta.x(), x44_colorDelta, x38_color); fog->RollFogOut(x48_rangeDelta.x(), x44_colorDelta, x38_color);
else else
fog->FadeFog(x34_mode, x38_color, x3c_range, x44_colorDelta, x48_rangeDelta); fog->FadeFog(x34_mode, x38_color, x3c_range, x44_colorDelta, x48_rangeDelta);
}
if (zeus::close_enough(x54_thermalSpeed, 0.f) && !zeus::close_enough(x5c_xraySpeed, 0.f)) {
CWorld* world = stateMgr.GetWorld();
CGameArea* area = world->GetArea(x4_areaId);
area->SetXRaySpeedAndTarget(x5c_xraySpeed, x58_xrayTarget);
} else {
CWorld* world = stateMgr.GetWorld(); CWorld* world = stateMgr.GetWorld();
CGameArea* area = world->GetArea(x4_areaId); CGameArea* area = world->GetArea(x4_areaId);
if (!zeus::close_enough(x54_thermalSpeed, 0.f)) {
area->SetThermalSpeedAndTarget(x54_thermalSpeed, x50_thermalTarget); area->SetThermalSpeedAndTarget(x54_thermalSpeed, x50_thermalTarget);
} }
if (!zeus::close_enough(x5c_xraySpeed, 0.f)) {
area->SetXRaySpeedAndTarget(x5c_xraySpeed, x58_xrayTarget);
}
} }
} }
} // namespace urde } // namespace urde