From ad22922393c7982b885840960222de64ff96ad36 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Sun, 14 Jan 2018 18:44:45 +0000 Subject: Rename cEntity swim states (#3996) * Replace cEntity:m_IsSubmerged with m_IsHeadInWater * Replace cEntity:m_IsSwimming with m_IsInWater * Add API documentation for new symbols * Apply SetSwimState to all entities, not just mobs and players * Pickups now use IsOnFire to check if they are on fire before destruction Fixes #3987 --- src/Entities/Player.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/Entities/Player.cpp') diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 073d00909..7b6719f55 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -92,9 +92,6 @@ cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) : { ASSERT(a_PlayerName.length() <= 16); // Otherwise this player could crash many clients... - m_IsSwimming = false; - m_IsSubmerged = false; - m_InventoryWindow = new cInventoryWindow(*this); m_CurrentWindow = m_InventoryWindow; m_InventoryWindow->OpenedByPlayer(*this); @@ -2503,12 +2500,7 @@ void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos, bool a_PreviousIs m_Stats.AddValue(statDistClimbed, FloorC(a_DeltaPos.y * 100 + 0.5)); } } - else if (IsSubmerged()) - { - m_Stats.AddValue(statDistDove, Value); - AddFoodExhaustion(0.00015 * static_cast(Value)); - } - else if (IsSwimming()) + else if (IsInWater()) { m_Stats.AddValue(statDistSwum, Value); AddFoodExhaustion(0.00015 * static_cast(Value)); -- cgit v1.2.3