summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-05 00:27:13 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-05 00:27:13 +0100
commitea2ce1595f51c141342991378c372529f26434c6 (patch)
tree47c69a342db56bc499f9d6bb4aec2aab7b8a76ea
parentFixed a bunch of MSVS warnings (diff)
downloadcuberite-ea2ce1595f51c141342991378c372529f26434c6.tar
cuberite-ea2ce1595f51c141342991378c372529f26434c6.tar.gz
cuberite-ea2ce1595f51c141342991378c372529f26434c6.tar.bz2
cuberite-ea2ce1595f51c141342991378c372529f26434c6.tar.lz
cuberite-ea2ce1595f51c141342991378c372529f26434c6.tar.xz
cuberite-ea2ce1595f51c141342991378c372529f26434c6.tar.zst
cuberite-ea2ce1595f51c141342991378c372529f26434c6.zip
-rw-r--r--src/Entities/Player.cpp17
-rw-r--r--src/Entities/Player.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 70c881091..c0466fa66 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -1760,6 +1760,23 @@ void cPlayer::UseEquippedItem(void)
+void cPlayer::TickBurning(cChunk & a_Chunk)
+{
+ // Don't burn in creative and stop burning in creative if necessary
+ if (!IsGameModeCreative())
+ {
+ super::TickBurning(a_Chunk);
+ }
+ else if (IsOnFire())
+ {
+ m_TicksLeftBurning = 0;
+ OnFinishedBurning();
+ }
+}
+
+
+
+
void cPlayer::HandleFood(void)
{
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index 784aac327..925011c9c 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -475,6 +475,9 @@ protected:
/// Filters out damage for creative mode/friendly fire
virtual void DoTakeDamage(TakeDamageInfo & TDI) override;
+
+ /** Stops players from burning in creative mode */
+ virtual void TickBurning(cChunk & a_Chunk) override;
/// Called in each tick to handle food-related processing
void HandleFood(void);