1
0
Fork 0

Implemented fall particles

This commit is contained in:
Tiger Wang 2013-12-22 20:03:09 +00:00
parent acb5a36a6a
commit 945ba36d1b
1 changed files with 18 additions and 3 deletions

View File

@ -247,6 +247,9 @@ void cPlayer::Tick(float a_Dt, cChunk & a_Chunk)
m_World->SendPlayerList(this);
m_LastPlayerListTime = t1.GetNowTime();
}
if (IsFlying())
m_LastGroundHeight = (float)GetPosY();
}
@ -447,10 +450,19 @@ void cPlayer::SetTouchGround(bool a_bTouchGround)
if (m_LastJumpHeight > m_LastGroundHeight) Damage++;
m_LastJumpHeight = (float)GetPosY();
if ((Damage > 0) && (!IsGameModeCreative()))
if (Damage > 0)
{
TakeDamage(dtFalling, NULL, Damage, Damage, 0);
}
if (!IsGameModeCreative())
{
TakeDamage(dtFalling, NULL, Damage, Damage, 0);
}
GetWorld()->BroadcastSoundParticleEffect(
2006,
(int)GetPosX(), (int)GetPosY() - 1, (int)GetPosZ(),
Damage // Used as particle effect speed modifier
);
}
m_LastGroundHeight = (float)GetPosY();
}
@ -974,6 +986,9 @@ void cPlayer::SetGameMode(eGameMode a_GameMode)
m_GameMode = a_GameMode;
m_ClientHandle->SendGameMode(a_GameMode);
SetFlying(false);
SetCanFly(false);
}