From cf22bc4e60b418bf9260720ef8eaef79ac38308b Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Sun, 2 Jul 2017 07:39:19 +0200 Subject: [PATCH] Players in creative and spectator aren't affected by cacti (#3824) --- src/Entities/Entity.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 9ff57602e..90613faf3 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -911,7 +911,10 @@ void cEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) m_TicksSinceLastVoidDamage = 0; } - if (IsMob() || IsPlayer() || IsPickup() || IsExpOrb()) + if ( + IsMob() || IsPickup() || IsExpOrb() || + (IsPlayer() && !((reinterpret_cast(this))->IsGameModeCreative() || (reinterpret_cast(this))->IsGameModeSpectator())) + ) { DetectCacti(); }