summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2013-12-21 17:31:05 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2013-12-21 17:31:05 +0100
commitbd6574230a0acbc538ce7328fc191130d3d8eac1 (patch)
tree91f4e5957c6d16c9dc22f416b49c3862f38b2132 /src/Entities/Player.cpp
parentFixed a file name. (diff)
downloadcuberite-bd6574230a0acbc538ce7328fc191130d3d8eac1.tar
cuberite-bd6574230a0acbc538ce7328fc191130d3d8eac1.tar.gz
cuberite-bd6574230a0acbc538ce7328fc191130d3d8eac1.tar.bz2
cuberite-bd6574230a0acbc538ce7328fc191130d3d8eac1.tar.lz
cuberite-bd6574230a0acbc538ce7328fc191130d3d8eac1.tar.xz
cuberite-bd6574230a0acbc538ce7328fc191130d3d8eac1.tar.zst
cuberite-bd6574230a0acbc538ce7328fc191130d3d8eac1.zip
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 8f30cd4cc..948a259ff 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())
@@ -1781,6 +1786,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())