From 30c8470a524f5d09f157d5c1c59eb72c205d5085 Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Tue, 19 Sep 2017 09:12:54 -0500 Subject: 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 --- src/Mobs/Creeper.cpp | 4 ++-- src/Mobs/Horse.cpp | 4 ++-- src/Mobs/Monster.cpp | 4 ++-- src/Mobs/Sheep.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Creeper.cpp b/src/Mobs/Creeper.cpp index adab8c5aa..aaf241dfb 100644 --- a/src/Mobs/Creeper.cpp +++ b/src/Mobs/Creeper.cpp @@ -127,7 +127,7 @@ bool cCreeper::Attack(std::chrono::milliseconds a_Dt) if (!m_bIsBlowing) { - m_World->BroadcastSoundEffect("entity.creeper.primed", GetPosX(), GetPosY(), GetPosZ(), 1.f, (0.75f + (static_cast((GetUniqueID() * 23) % 32)) / 64)); + m_World->BroadcastSoundEffect("entity.creeper.primed", GetPosition(), 1.f, (0.75f + (static_cast((GetUniqueID() * 23) % 32)) / 64)); m_bIsBlowing = true; m_World->BroadcastEntityMetadata(*this); @@ -150,7 +150,7 @@ void cCreeper::OnRightClicked(cPlayer & a_Player) { a_Player.UseEquippedItem(); } - m_World->BroadcastSoundEffect("entity.creeper.primed", GetPosX(), GetPosY(), GetPosZ(), 1.f, (0.75f + (static_cast((GetUniqueID() * 23) % 32)) / 64)); + m_World->BroadcastSoundEffect("entity.creeper.primed", GetPosition(), 1.f, (0.75f + (static_cast((GetUniqueID() * 23) % 32)) / 64)); m_bIsBlowing = true; m_World->BroadcastEntityMetadata(*this); m_BurnedWithFlintAndSteel = true; diff --git a/src/Mobs/Horse.cpp b/src/Mobs/Horse.cpp index 13630b0e3..c55acf572 100644 --- a/src/Mobs/Horse.cpp +++ b/src/Mobs/Horse.cpp @@ -70,7 +70,7 @@ void cHorse::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) m_World->BroadcastSoundParticleEffect(EffectID::PARTICLE_SMOKE, FloorC(GetPosX()), FloorC(GetPosY()), FloorC(GetPosZ()), int(SmokeDirection::NORTH_EAST)); m_World->BroadcastSoundParticleEffect(EffectID::PARTICLE_SMOKE, FloorC(GetPosX()), FloorC(GetPosY()), FloorC(GetPosZ()), int(SmokeDirection::NORTH_WEST)); - m_World->BroadcastSoundEffect("entity.horse.angry", GetPosX(), GetPosY(), GetPosZ(), 1.0f, 1.0f); + m_World->BroadcastSoundEffect("entity.horse.angry", GetPosition(), 1.0f, 1.0f); m_Attachee->Detach(); m_bIsRearing = true; } @@ -159,7 +159,7 @@ void cHorse::OnRightClicked(cPlayer & a_Player) { m_bIsRearing = true; m_RearTickCount = 0; - m_World->BroadcastSoundEffect("entity.horse.angry", GetPosX(), GetPosY(), GetPosZ(), 1.0f, 0.8f); + m_World->BroadcastSoundEffect("entity.horse.angry", GetPosition(), 1.0f, 0.8f); } } diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 2ff1f74d8..db1150f67 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -557,7 +557,7 @@ bool cMonster::DoTakeDamage(TakeDamageInfo & a_TDI) if (!m_SoundHurt.empty() && (m_Health > 0)) { - m_World->BroadcastSoundEffect(m_SoundHurt, GetPosX(), GetPosY(), GetPosZ(), 1.0f, 0.8f); + m_World->BroadcastSoundEffect(m_SoundHurt, GetPosition(), 1.0f, 0.8f); } if ((a_TDI.Attacker != nullptr) && a_TDI.Attacker->IsPawn()) @@ -583,7 +583,7 @@ void cMonster::KilledBy(TakeDamageInfo & a_TDI) super::KilledBy(a_TDI); if (m_SoundHurt != "") { - m_World->BroadcastSoundEffect(m_SoundDeath, GetPosX(), GetPosY(), GetPosZ(), 1.0f, 0.8f); + m_World->BroadcastSoundEffect(m_SoundDeath, GetPosition(), 1.0f, 0.8f); } int Reward; switch (m_MobType) diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp index fef1adac6..814c87f5d 100644 --- a/src/Mobs/Sheep.cpp +++ b/src/Mobs/Sheep.cpp @@ -67,7 +67,7 @@ void cSheep::OnRightClicked(cPlayer & a_Player) char NumDrops = GetRandomProvider().RandInt(1, 3); Drops.emplace_back(E_BLOCK_WOOL, NumDrops, static_cast(m_WoolColor)); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); - m_World->BroadcastSoundEffect("entity.sheep.shear", GetPosX(), GetPosY(), GetPosZ(), 1.0f, 1.0f); + m_World->BroadcastSoundEffect("entity.sheep.shear", GetPosition(), 1.0f, 1.0f); } else if ((EquippedItem.m_ItemType == E_ITEM_DYE) && (m_WoolColor != 15 - EquippedItem.m_ItemDamage)) { -- cgit v1.2.3