Tools make a sound when breaking, fixes #266
This commit is contained in:
parent
77a7bfb3e5
commit
44d5fd1e87
@ -1575,7 +1575,10 @@ void cPlayer::UseEquippedItem(void)
|
|||||||
return;
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -466,7 +466,7 @@ void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
|
|||||||
m_HitBlockPos = Vector3i(a_X, a_Y, a_Z);
|
m_HitBlockPos = Vector3i(a_X, a_Y, a_Z);
|
||||||
|
|
||||||
// Broadcast arrow hit sound
|
// 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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user