diff options
author | Mattes D <github@xoft.cz> | 2013-12-08 18:07:34 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-12-08 18:07:34 +0100 |
commit | 6f23d2ec94b30e355edc63c2de464d40ff3d0ed8 (patch) | |
tree | 3127fecd22be0f755e81c384c72a171e52987458 /src/Entities | |
parent | Removed unused ToLua files. (diff) | |
parent | Fixed binding generation and VS2013 compile (diff) | |
download | cuberite-6f23d2ec94b30e355edc63c2de464d40ff3d0ed8.tar cuberite-6f23d2ec94b30e355edc63c2de464d40ff3d0ed8.tar.gz cuberite-6f23d2ec94b30e355edc63c2de464d40ff3d0ed8.tar.bz2 cuberite-6f23d2ec94b30e355edc63c2de464d40ff3d0ed8.tar.lz cuberite-6f23d2ec94b30e355edc63c2de464d40ff3d0ed8.tar.xz cuberite-6f23d2ec94b30e355edc63c2de464d40ff3d0ed8.tar.zst cuberite-6f23d2ec94b30e355edc63c2de464d40ff3d0ed8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Player.cpp | 13 | ||||
-rw-r--r-- | src/Entities/ProjectileEntity.cpp | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index c025a9ee8..7a5ff5696 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -572,7 +572,7 @@ void cPlayer::StartEating(void) m_EatingFinishTick = m_World->GetWorldAge() + EATING_TICKS; // Send the packets: - m_World->BroadcastPlayerAnimation(*this, 5); + m_World->BroadcastEntityAnimation(*this, 3); m_World->BroadcastEntityMetadata(*this); } @@ -587,7 +587,7 @@ void cPlayer::FinishEating(void) // Send the packets: m_ClientHandle->SendEntityStatus(*this, ENTITY_STATUS_EATING_ACCEPTED); - m_World->BroadcastPlayerAnimation(*this, 0); + m_World->BroadcastEntityAnimation(*this, 0); m_World->BroadcastEntityMetadata(*this); // consume the item: @@ -616,7 +616,7 @@ void cPlayer::FinishEating(void) void cPlayer::AbortEating(void) { m_EatingFinishTick = -1; - m_World->BroadcastPlayerAnimation(*this, 0); + m_World->BroadcastEntityAnimation(*this, 0); m_World->BroadcastEntityMetadata(*this); } @@ -1328,7 +1328,7 @@ void cPlayer::TossItem( double vX = 0, vY = 0, vZ = 0; EulerToVector(-GetRotation(), GetPitch(), vZ, vX, vY); vY = -vY * 2 + 1.f; - m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY() + 1.6f, GetPosZ(), vX * 3, vY * 3, vZ * 3, true); // 'true' because created by player + m_World->SpawnItemPickups(Drops, GetPosX(), GetEyeHeight(), GetPosZ(), vX * 3, vY * 3, vZ * 3, true); // 'true' because created by player } @@ -1575,7 +1575,10 @@ void cPlayer::UseEquippedItem(void) return; } - GetInventory().DamageEquippedItem(); + if (GetInventory().DamageEquippedItem()) + { + m_World->BroadcastSoundEffect("random.break", (int)GetPosX() * 8, (int)GetPosY() * 8, (int)GetPosZ() * 8, 0.5f, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64)); + } } diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp index fb25aea35..1d49c2445 100644 --- a/src/Entities/ProjectileEntity.cpp +++ b/src/Entities/ProjectileEntity.cpp @@ -466,7 +466,7 @@ void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) m_HitBlockPos = Vector3i(a_X, a_Y, a_Z); // Broadcast arrow hit sound - m_World->BroadcastSoundEffect("random.bowhit", (int)GetPosX() * 8, (int)GetPosY() * 8, (int)GetPosZ() * 8, 0.5, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64)); + m_World->BroadcastSoundEffect("random.bowhit", (int)GetPosX() * 8, (int)GetPosY() * 8, (int)GetPosZ() * 8, 0.5f, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64)); } |