summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-19 21:40:56 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-19 21:40:56 +0200
commit42c36429d7cd1e6c3f879b6749e18e912deefe0d (patch)
treecd6f9a0ddf88a738596018311702d19d07fc0b5c /src/Entities/Player.cpp
parentMerge pull request #1010 from mc-server/cactidamage (diff)
downloadcuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.gz
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.bz2
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.lz
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.xz
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.zst
cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index c3b763278..3a32bfb2e 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1169,8 +1169,8 @@ unsigned int cPlayer::AwardAchievement(const eStatistic a_Ach)
{
// First time, announce it
cCompositeChat Msg;
- Msg.AddTextPart(m_PlayerName + " has just earned the achievement ");
- Msg.AddTextPart(cStatInfo::GetName(a_Ach)); // TODO 2014-05-12 xdot: Use the proper cCompositeChat part (cAchievement)
+ Msg.SetMessageType(mtSuccess);
+ Msg.AddShowAchievementPart(GetName(), cStatInfo::GetName(a_Ach));
m_World->BroadcastChat(Msg);
// Increment the statistic
@@ -1788,7 +1788,7 @@ bool cPlayer::SaveToDisk()
// Save the player stats.
// We use the default world name (like bukkit) because stats are shared between dimensions/worlds.
- cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), m_PlayerName, &m_Stats);
+ cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats);
if (!StatSerializer.Save())
{
LOGERROR("Could not save stats for player %s", m_PlayerName.c_str());
@@ -1963,7 +1963,7 @@ void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos)
BLOCKTYPE Block;
NIBBLETYPE Meta;
- if (!m_World->GetBlockTypeMeta(PosX, PosY, PosZ, Block, Meta))
+ if ((PosY < 0) || (PosY > cChunkDef::Height) || !m_World->GetBlockTypeMeta(PosX, PosY, PosZ, Block, Meta))
{
return;
}