Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)
* Made BroadcastSoundEffect take vector parameters. * Added docs for new vectored methods * Removed old code * Fixed lua warnings * Made old BroadcastSoundEffect not an override. * m_Block to m_BlockPos, used Vector3d constructor where prettier. * a_Block to a_BlockPos * Changed thunderbolt a_Block to a_BlockPos
This commit is contained in:
@@ -243,15 +243,13 @@ void cNoteEntity::MakeSound(void)
|
||||
}
|
||||
}
|
||||
|
||||
m_World->BroadcastBlockAction(m_PosX, m_PosY, m_PosZ, static_cast<Byte>(instrument), static_cast<Byte>(m_Pitch), E_BLOCK_NOTE_BLOCK);
|
||||
m_World->BroadcastBlockAction({m_PosX, m_PosY, m_PosZ}, static_cast<Byte>(instrument), static_cast<Byte>(m_Pitch), E_BLOCK_NOTE_BLOCK);
|
||||
|
||||
// TODO: instead of calculating the power function over and over, make a precalculated table - there's only 24 pitches after all
|
||||
float calcPitch = static_cast<float>(pow(2.0f, static_cast<float>(m_Pitch - 12.0f) / 12.0f));
|
||||
m_World->BroadcastSoundEffect(
|
||||
sampleName,
|
||||
static_cast<double>(m_PosX),
|
||||
static_cast<double>(m_PosY),
|
||||
static_cast<double>(m_PosZ),
|
||||
Vector3d(m_PosX, m_PosY, m_PosZ),
|
||||
3.0f,
|
||||
calcPitch
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user