summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorJames Ravenscroft <ravenscroftj@gmail.com>2013-08-08 12:01:45 +0200
committerJames Ravenscroft <ravenscroftj@gmail.com>2013-08-08 12:01:45 +0200
commit864bdd2626fbbdca10d1ddfe934334c41ccc3571 (patch)
tree876f8915d573c098575c23617d7f9368f62245da /source
parentFixed the formatting issues in player cpp files (diff)
downloadcuberite-864bdd2626fbbdca10d1ddfe934334c41ccc3571.tar
cuberite-864bdd2626fbbdca10d1ddfe934334c41ccc3571.tar.gz
cuberite-864bdd2626fbbdca10d1ddfe934334c41ccc3571.tar.bz2
cuberite-864bdd2626fbbdca10d1ddfe934334c41ccc3571.tar.lz
cuberite-864bdd2626fbbdca10d1ddfe934334c41ccc3571.tar.xz
cuberite-864bdd2626fbbdca10d1ddfe934334c41ccc3571.tar.zst
cuberite-864bdd2626fbbdca10d1ddfe934334c41ccc3571.zip
Diffstat (limited to 'source')
-rw-r--r--source/Player.cpp14
-rw-r--r--source/Player.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/source/Player.cpp b/source/Player.cpp
index 21f31c555..fb752ed87 100644
--- a/source/Player.cpp
+++ b/source/Player.cpp
@@ -1322,8 +1322,8 @@ void cPlayer::UseEquippedItem()
void cPlayer::HandleAir(cChunk & a_Chunk)
{
- //Ref.: http://www.minecraftwiki.net/wiki/Chunk_format
- //see if the player is /submerged/ water (block above is water)
+ // Ref.: http://www.minecraftwiki.net/wiki/Chunk_format
+ // see if the player is /submerged/ water (block above is water)
// Get the type of block the player's standing in:
BLOCKTYPE BlockIn;
int RelX = (int)floor(m_LastPosX) - a_Chunk.GetPosX() * cChunkDef::Width;
@@ -1334,24 +1334,24 @@ void cPlayer::HandleAir(cChunk & a_Chunk)
if (IsBlockWater(BlockIn))
{
- //either reduce air level or damage player
+ // either reduce air level or damage player
if(m_AirLevel < 1)
{
if(m_AirTickTimer < 1)
{
- //damage player
+ // damage player
TakeDamage(dtDrowning, NULL, 1, 1, 0);
- //reset timer
+ // reset timer
m_AirTickTimer = DROWNING_TICKS;
}else{
m_AirTickTimer -= 1;
}
}else{
- //reduce air supply
+ // reduce air supply
m_AirLevel -= 1;
}
}else{
- //set the air back to maximum
+ // set the air back to maximum
m_AirLevel = MAX_AIR_LEVEL;
m_AirTickTimer = DROWNING_TICKS;
}
diff --git a/source/Player.h b/source/Player.h
index f1d746318..542656b5a 100644
--- a/source/Player.h
+++ b/source/Player.h
@@ -271,9 +271,9 @@ protected:
std::string m_PlayerName;
std::string m_LoadedWorldName;
- //Player's air level (for swimming)
+ /// Player's air level (for swimming)
int m_AirLevel;
- //used to time ticks between damage taken via drowning/suffocation
+ /// used to time ticks between damage taken via drowning/suffocation
int m_AirTickTimer;
bool m_bVisible;