From 9a839a3a98eee4a6e8c64bb5829baee3fbb0f7e3 Mon Sep 17 00:00:00 2001 From: "luksor111@gmail.com" Date: Sat, 15 Dec 2012 13:27:01 +0000 Subject: Fixed fall damage again Added sound effects to pistons git-svn-id: http://mc-server.googlecode.com/svn/trunk@1074 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Piston.cpp | 2 ++ source/Player.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/Piston.cpp b/source/Piston.cpp index 9aa09a56e..ee4f030c9 100644 --- a/source/Piston.cpp +++ b/source/Piston.cpp @@ -83,6 +83,7 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz ) oldz = pistz; } m_World->BroadcastBlockAction(pistx, pisty, pistz, 0, pistonMeta, E_BLOCK_PISTON); + m_World->BroadcastSoundEffect("tile.piston.out", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8 ); int extx = pistx; @@ -108,6 +109,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz ) return; } m_World->BroadcastBlockAction(pistx, pisty, pistz, 1, pistonMeta & ~(8), E_BLOCK_PISTON); + m_World->BroadcastSoundEffect("tile.piston.in", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f); m_World->FastSetBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8)); AddDir(pistx, pisty, pistz, pistonMeta & 7, 1) diff --git a/source/Player.cpp b/source/Player.cpp index 31dc001ca..555b8d3f9 100644 --- a/source/Player.cpp +++ b/source/Player.cpp @@ -291,7 +291,7 @@ void cPlayer::SetTouchGround(bool a_bTouchGround) if (m_bTouchGround) { - float Dist = (float)(m_LastGroundHeight - m_Pos.y); + float Dist = (float)(m_LastGroundHeight - floor(m_Pos.y)); int Damage = (int)(Dist - 3.f); if(m_LastJumpHeight > m_LastGroundHeight) Damage++; m_LastJumpHeight = (float)m_Pos.y; -- cgit v1.2.3