Now using appropriate variable to see if a player is on ground. Does not check if playervel.y == 0 which will be false if a player is on a obstacle.

This commit is contained in:
stiffly
2016-02-10 14:07:11 +01:00
parent 645ee9013a
commit c2128790af
2 changed files with 5 additions and 6 deletions
+2 -2
View File
@@ -69,8 +69,8 @@ bool SoundSystem::OnInputCommand(const Events::InputCommand & e)
void SoundSystem::playerJumps()
{
glm::vec3 vel = (glm::vec3)m_World->GetComponent(m_LocalPlayer.ID, "Physics")["Velocity"];
if (vel.y == 0) {
bool grounded = (bool)m_World->GetComponent(m_LocalPlayer.ID, "Physics")["IsOnGround"];
if (grounded) {
Events::PlaySoundOnEntity e;
e.EmitterID = m_LocalPlayer.ID;
e.FilePath = "Audio/jump/jump1.wav";