1
0
Fork 0

Tweak pickup sound pitch (#4598)

This commit is contained in:
Mat 2020-04-03 18:49:12 +03:00 committed by GitHub
parent 2e615914ea
commit 4ed182c13a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -154,7 +154,7 @@ void cArrowEntity::CollectedBy(cPlayer & a_Dest)
} }
GetWorld()->BroadcastCollectEntity(*this, a_Dest, 1); GetWorld()->BroadcastCollectEntity(*this, a_Dest, 1);
GetWorld()->BroadcastSoundEffect("entity.item.pickup", GetPosition(), 0.5, static_cast<float>(0.75 + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64)); GetWorld()->BroadcastSoundEffect("entity.item.pickup", GetPosition(), 0.3f, (1.2f + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64));
m_bIsCollected = true; m_bIsCollected = true;
} }
} }

View File

@ -255,7 +255,7 @@ bool cPickup::CollectedBy(cPlayer & a_Dest)
m_World->BroadcastCollectEntity(*this, a_Dest, NumAdded); m_World->BroadcastCollectEntity(*this, a_Dest, NumAdded);
// Also send the "pop" sound effect with a somewhat random pitch (fast-random using EntityID ;) // Also send the "pop" sound effect with a somewhat random pitch (fast-random using EntityID ;)
m_World->BroadcastSoundEffect("entity.item.pickup", GetPosition(), 0.5, (0.75f + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64)); m_World->BroadcastSoundEffect("entity.item.pickup", GetPosition(), 0.3f, (1.2f + (static_cast<float>((GetUniqueID() * 23) % 32)) / 64));
if (m_Item.m_ItemCount <= 0) if (m_Item.m_ItemCount <= 0)
{ {
// All of the pickup has been collected, schedule the pickup for destroying // All of the pickup has been collected, schedule the pickup for destroying