Fixed crash when trying to jump, when no player is spawned.

This commit is contained in:
stiffly
2016-02-10 17:17:41 +01:00
parent c2128790af
commit 1ba9d97ab7
+3
View File
@@ -69,6 +69,9 @@ bool SoundSystem::OnInputCommand(const Events::InputCommand & e)
void SoundSystem::playerJumps()
{
if (!m_LocalPlayer.Valid()) {
return;
}
bool grounded = (bool)m_World->GetComponent(m_LocalPlayer.ID, "Physics")["IsOnGround"];
if (grounded) {
Events::PlaySoundOnEntity e;