summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-05-09 13:22:59 +0200
committerMattes D <github@xoft.cz>2015-05-09 13:22:59 +0200
commitca949447eefe74804e677fff5a46a1f18a826901 (patch)
tree911736baccf3617a13f6b7e04ebbfe3fe035fb50 /src/Entities/Player.cpp
parentRabbit and cooked rabbit now stackable (diff)
parentAdded check against "Type const &" and "Type const *". (diff)
downloadcuberite-ca949447eefe74804e677fff5a46a1f18a826901.tar
cuberite-ca949447eefe74804e677fff5a46a1f18a826901.tar.gz
cuberite-ca949447eefe74804e677fff5a46a1f18a826901.tar.bz2
cuberite-ca949447eefe74804e677fff5a46a1f18a826901.tar.lz
cuberite-ca949447eefe74804e677fff5a46a1f18a826901.tar.xz
cuberite-ca949447eefe74804e677fff5a46a1f18a826901.tar.zst
cuberite-ca949447eefe74804e677fff5a46a1f18a826901.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 7f625f5d4..607a663de 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -355,7 +355,7 @@ float cPlayer::GetXpPercentage()
int currentLevel_XpBase = XpForLevel(currentLevel);
return static_cast<float>(m_CurrentXp - currentLevel_XpBase) /
- static_cast<float>(XpForLevel(1+currentLevel) - currentLevel_XpBase);
+ static_cast<float>(XpForLevel(1 + currentLevel) - currentLevel_XpBase);
}
@@ -364,7 +364,7 @@ float cPlayer::GetXpPercentage()
bool cPlayer::SetCurrentExperience(int a_CurrentXp)
{
- if (!(a_CurrentXp >= 0) || (a_CurrentXp > (std::numeric_limits<int>().max() - m_LifetimeTotalXp)))
+ if (!(a_CurrentXp >= 0) || (a_CurrentXp > (std::numeric_limits<int>::max() - m_LifetimeTotalXp)))
{
LOGWARNING("Tried to update experiece with an invalid Xp value: %d", a_CurrentXp);
return false; // oops, they gave us a dodgey number
@@ -403,7 +403,7 @@ int cPlayer::DeltaExperience(int a_Xp_delta)
m_LifetimeTotalXp += a_Xp_delta;
}
- LOGD("Player \"%s\" gained/lost %d experience, total is now: %d", GetName().c_str(), a_Xp_delta, m_CurrentXp);
+ LOGD("Player \"%s\" gained / lost %d experience, total is now: %d", GetName().c_str(), a_Xp_delta, m_CurrentXp);
// Set experience to be updated
m_bDirtyExperience = true;
@@ -1771,7 +1771,7 @@ bool cPlayer::LoadFromFile(const AString & a_FileName, cWorldPtr & a_World)
m_LastBedPos.z = root.get("SpawnZ", a_World->GetSpawnZ()).asInt();
// Load the player stats.
- // We use the default world name (like bukkit) because stats are shared between dimensions/worlds.
+ // We use the default world name (like bukkit) because stats are shared between dimensions / worlds.
cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats);
StatSerializer.Load();
@@ -1868,7 +1868,7 @@ bool cPlayer::SaveToDisk()
}
// Save the player stats.
- // We use the default world name (like bukkit) because stats are shared between dimensions/worlds.
+ // We use the default world name (like bukkit) because stats are shared between dimensions / worlds.
cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats);
if (!StatSerializer.Save())
{
@@ -2076,7 +2076,7 @@ void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos)
}
else
{
- if (Value >= 25) // Ignore small/slow movement
+ if (Value >= 25) // Ignore small / slow movement
{
m_Stats.AddValue(statDistFlown, Value);
}