player_patches: ensure Unleash gauge penalty doesn't dip into negatives

This commit is contained in:
Hyper 2024-11-20 01:25:58 +00:00
parent 809c88408e
commit 16484a2343

View file

@ -86,7 +86,7 @@ void PostUnleashMidAsmHook(PPCRegister& r30)
if (m_isUnleashCancelled)
{
if (auto pEvilSonicContext = (SWA::Player::CEvilSonicContext*)g_memory.Translate(r30.u32))
pEvilSonicContext->m_DarkGaiaEnergy = m_lastDarkGaiaEnergy - 35.0f;
pEvilSonicContext->m_DarkGaiaEnergy = std::max(0.0f, m_lastDarkGaiaEnergy - 35.0f);
m_isUnleashCancelled = false;
}