1
0
Fork 0

Tools make a sound when breaking, fixes #266

This commit is contained in:
Tiger Wang 2013-12-06 19:59:14 +00:00
parent 77a7bfb3e5
commit 44d5fd1e87
2 changed files with 5 additions and 2 deletions

View File

@ -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));
}
}

View File

@ -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));
}