summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 41c1542d3..0fa8254ce 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -240,6 +240,11 @@ void cPlayer::Tick(float a_Dt, cChunk & a_Chunk)
HandleFood();
}
+ if (m_IsFishing)
+ {
+ HandleFloater();
+ }
+
// Send Player List (Once per m_LastPlayerListTime/1000 ms)
cTimer t1;
if (m_LastPlayerListTime + cPlayer::PLAYER_LIST_TIME_MS <= t1.GetNowTime())
@@ -1306,7 +1311,7 @@ AString cPlayer::GetColor(void) const
{
if ( m_Color != '-' )
{
- return cChatColor::MakeColor( m_Color );
+ return cChatColor::Color + m_Color;
}
if ( m_Groups.size() < 1 )
@@ -1798,6 +1803,30 @@ void cPlayer::HandleFood(void)
+void cPlayer::HandleFloater()
+{
+ if (GetEquippedItem().m_ItemType == E_ITEM_FISHING_ROD)
+ {
+ return;
+ }
+ class cFloaterCallback :
+ public cEntityCallback
+ {
+ public:
+ virtual bool Item(cEntity * a_Entity) override
+ {
+ a_Entity->Destroy(true);
+ return true;
+ }
+ } Callback;
+ m_World->DoWithEntityByID(m_FloaterID, Callback);
+ SetIsFishing(false);
+}
+
+
+
+
+
void cPlayer::ApplyFoodExhaustionFromMovement()
{
if (IsGameModeCreative())