2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 23:47:42 +00:00

Fix SCAN state saving, clean up MLVL, add support for newer CRasterFont versions

This commit is contained in:
2017-02-08 23:37:00 -08:00
parent 8a5e0ec775
commit 7e4c82a013
6 changed files with 54 additions and 19 deletions

View File

@@ -203,8 +203,8 @@ CPlayerState::EPlayerSuit CPlayerState::GetCurrentSuit() const
bool CPlayerState::CanVisorSeeFog(const CStateManager& stateMgr) const
{
u32 activeVisor = u32(GetActiveVisor(stateMgr));
if (activeVisor == 0 || activeVisor == 2)
EPlayerVisor activeVisor = GetActiveVisor(stateMgr);
if (activeVisor == EPlayerVisor::Combat || activeVisor == EPlayerVisor::Scan)
return true;
return true;
}
@@ -222,9 +222,26 @@ void CPlayerState::UpdateStaticInterference(CStateManager& stateMgr, const float
x188_staticIntf.Update(stateMgr, dt);
}
void CPlayerState::IncreaseScanTime(u32 time, float val)
void CPlayerState::SetScanTime(ResId res, float time)
{
auto it = std::find_if(x170_scanTimes.begin(), x170_scanTimes.end(), [&](const auto& test) -> bool{
return test.first == res;
});
if (it != x170_scanTimes.end())
it->second = time;
}
float CPlayerState::GetScanTime(ResId res) const
{
const auto it = std::find_if(x170_scanTimes.cbegin(), x170_scanTimes.cend(), [&](const auto& test) -> bool{
return test.first == res;
});
if (it == x170_scanTimes.end())
return 0.f;
return it->second;
}
bool CPlayerState::GetIsVisorTransitioning() const