Fixed some formatting issues I accidentally introduced
This commit is contained in:
parent
ffce5d143f
commit
6963e8119c
@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define AddPistonDir(x, y, z, dir, amount) switch (dir) { case 0: (y)-=(amount); break; case 1: (y)+=(amount); break;\
|
#define AddPistonDir(x, y, z, dir, amount) switch (dir) { case 0: (y)-=(amount); break; case 1: (y)+=(amount); break;\
|
||||||
case 2: (z)-=(amount); break; case 3: (z)+=(amount); break;\
|
case 2: (z)-=(amount); break; case 3: (z)+=(amount); break;\
|
||||||
case 4: (x)-=(amount); break; case 5: (x)+=(amount); break; }
|
case 4: (x)-=(amount); break; case 5: (x)+=(amount); break; }
|
||||||
|
@ -61,8 +61,8 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
|
|||||||
, m_SprintingMaxSpeed(0.13)
|
, m_SprintingMaxSpeed(0.13)
|
||||||
, m_IsCrouched(false)
|
, m_IsCrouched(false)
|
||||||
, m_IsSprinting(false)
|
, m_IsSprinting(false)
|
||||||
, m_IsSwimming(false)
|
, m_IsSwimming(false)
|
||||||
, m_IsSubmerged(false)
|
, m_IsSubmerged(false)
|
||||||
, m_EatingFinishTick(-1)
|
, m_EatingFinishTick(-1)
|
||||||
{
|
{
|
||||||
LOGD("Created a player object for \"%s\" @ \"%s\" at %p, ID %d",
|
LOGD("Created a player object for \"%s\" @ \"%s\" at %p, ID %d",
|
||||||
@ -182,9 +182,9 @@ void cPlayer::Tick(float a_Dt, cChunk & a_Chunk)
|
|||||||
}
|
}
|
||||||
|
|
||||||
super::Tick(a_Dt, a_Chunk);
|
super::Tick(a_Dt, a_Chunk);
|
||||||
|
|
||||||
// set player swimming state
|
// set player swimming state
|
||||||
SetSwimState( a_Chunk);
|
SetSwimState( a_Chunk);
|
||||||
|
|
||||||
// handle air drowning stuff
|
// handle air drowning stuff
|
||||||
HandleAir();
|
HandleAir();
|
||||||
@ -1338,18 +1338,19 @@ void cPlayer::SetSwimState(cChunk & a_Chunk)
|
|||||||
int RelX = (int)floor(m_LastPosX) - a_Chunk.GetPosX() * cChunkDef::Width;
|
int RelX = (int)floor(m_LastPosX) - a_Chunk.GetPosX() * cChunkDef::Width;
|
||||||
int RelY = (int)floor(m_LastPosY + 0.1);
|
int RelY = (int)floor(m_LastPosY + 0.1);
|
||||||
int RelZ = (int)floor(m_LastPosZ) - a_Chunk.GetPosZ() * cChunkDef::Width;
|
int RelZ = (int)floor(m_LastPosZ) - a_Chunk.GetPosZ() * cChunkDef::Width;
|
||||||
// first we check if the player is swimming
|
|
||||||
|
// first we check if the player is swimming
|
||||||
|
|
||||||
// Use Unbounded, because we're being called *after* processing super::Tick(), which could have changed our chunk
|
// Use Unbounded, because we're being called *after* processing super::Tick(), which could have changed our chunk
|
||||||
VERIFY(a_Chunk.UnboundedRelGetBlockType(RelX, RelY, RelZ, BlockIn));
|
VERIFY(a_Chunk.UnboundedRelGetBlockType(RelX, RelY, RelZ, BlockIn));
|
||||||
|
|
||||||
m_IsSwimming = IsBlockWater(BlockIn);
|
m_IsSwimming = IsBlockWater(BlockIn);
|
||||||
|
|
||||||
// now we check if the player is submerged
|
|
||||||
|
|
||||||
VERIFY(a_Chunk.UnboundedRelGetBlockType(RelX, RelY+1, RelZ, BlockIn));
|
// now we check if the player is submerged
|
||||||
|
|
||||||
m_IsSubmerged = IsBlockWater(BlockIn);
|
VERIFY(a_Chunk.UnboundedRelGetBlockType(RelX, RelY+1, RelZ, BlockIn));
|
||||||
|
|
||||||
|
m_IsSubmerged = IsBlockWater(BlockIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cPlayer::HandleAir()
|
void cPlayer::HandleAir()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user