improve readability of MxBackgroundAudioManager::Enable

While the previous iteration wasn't incorrect, it definitely reads like pseudocode (i.e. it's very unlikely any actual developers would have written that). This is much more readable/likely to have been written and still results in the same asm.
This commit is contained in:
itsmattkc 2023-08-03 11:39:21 -07:00
parent 32a7916297
commit 3a28fdae6f

View File

@ -31,9 +31,12 @@ void MxBackgroundAudioManager::Stop()
// OFFSET: LEGO1 0x1007f5f0 // OFFSET: LEGO1 0x1007f5f0
void MxBackgroundAudioManager::Enable(MxBool p) void MxBackgroundAudioManager::Enable(MxBool p)
{ {
if ((this->m_musicEnabled != p) && (this->m_musicEnabled = p, !p)) { if (this->m_musicEnabled != p) {
Stop(); this->m_musicEnabled = p;
} if (!p) {
Stop();
}
}
} }
// OFFSET: LEGO1 0x1007f650 // OFFSET: LEGO1 0x1007f650