summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-16 14:37:36 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-16 14:37:36 +0100
commit4908b6f500aa31ca550536c7e5a49e660ff72b65 (patch)
treedc06fbfad743379da13f883b3bee655e116688e3
parentMerge pull request #685 from MuhammadWang/patch-1 (diff)
downloadcuberite-4908b6f500aa31ca550536c7e5a49e660ff72b65.tar
cuberite-4908b6f500aa31ca550536c7e5a49e660ff72b65.tar.gz
cuberite-4908b6f500aa31ca550536c7e5a49e660ff72b65.tar.bz2
cuberite-4908b6f500aa31ca550536c7e5a49e660ff72b65.tar.lz
cuberite-4908b6f500aa31ca550536c7e5a49e660ff72b65.tar.xz
cuberite-4908b6f500aa31ca550536c7e5a49e660ff72b65.tar.zst
cuberite-4908b6f500aa31ca550536c7e5a49e660ff72b65.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/ExpOrb.cpp6
-rw-r--r--src/Entities/Player.cpp11
-rw-r--r--src/Entities/Player.h2
3 files changed, 3 insertions, 16 deletions
diff --git a/src/Entities/ExpOrb.cpp b/src/Entities/ExpOrb.cpp
index 41b60cc3b..3398f1c7b 100644
--- a/src/Entities/ExpOrb.cpp
+++ b/src/Entities/ExpOrb.cpp
@@ -52,11 +52,9 @@ void cExpOrb::Tick(float a_Dt, cChunk & a_Chunk)
LOGD("Player %s picked up an ExpOrb. His reward is %i", a_ClosestPlayer->GetName().c_str(), m_Reward);
a_ClosestPlayer->DeltaExperience(m_Reward);
- float r1 = (float) (0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64); // Random Float Value
- float r2 = (float) (0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64); // Random Float Value
- m_World->BroadcastSoundEffect("random.orb", (int) (GetPosX() * 8.0F), (int) (GetPosY() * 8.0F), (int) (GetPosZ() * 8.0F), 0.1F, 0.5F * ((r1 - r2) * 0.7F + 1.8F));
+ m_World->BroadcastSoundEffect("random.orb", (int)GetPosX() * 8, (int)GetPosY() * 8, (int)GetPosZ() * 8, 0.5f, (float)(0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64));
- Destroy(true);
+ Destroy();
}
a_Distance.Normalize();
a_Distance *= ((float) (5.5 - Distance));
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index be26e4f6e..70ddb3c98 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1059,15 +1059,6 @@ void cPlayer::CloseWindowIfID(char a_WindowID, bool a_CanRefuse)
-void cPlayer::PlaySoundEffect(const AString & a_SoundName, float a_Volume, float a_Pitch)
-{
- m_ClientHandle->SendSoundEffect(a_SoundName, (int) (GetPosX() * 8.0), (int) (GetPosY() * 8.0), (int) (GetPosZ() * 8.0), a_Volume, a_Pitch);
-}
-
-
-
-
-
void cPlayer::SetLastBlockActionTime()
{
if (m_World != NULL)
@@ -1796,7 +1787,7 @@ void cPlayer::HandleFood(void)
Heal(1);
m_FoodExhaustionLevel += 3;
}
- else if (m_FoodLevel <= 0 && m_Health > 1)
+ else if ((m_FoodLevel <= 0) && (m_Health > 1))
{
// Damage from starving
TakeDamage(dtStarving, NULL, 1, 1, 0);
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index 838f0301d..53e4b56db 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -208,8 +208,6 @@ public:
const AString & GetName(void) const { return m_PlayerName; }
void SetName(const AString & a_Name) { m_PlayerName = a_Name; }
- void PlaySoundEffect(const AString & a_SoundName, float a_Volume, float a_Pitch);
-
// tolua_end
typedef std::list< cGroup* > GroupList;