summaryrefslogtreecommitdiffstats
path: root/src/Entities/Boat.cpp
diff options
context:
space:
mode:
authorSimerson <66266021+Simerson@users.noreply.github.com>2021-01-28 23:39:40 +0100
committerGitHub <noreply@github.com>2021-01-28 23:39:40 +0100
commitb1b7424c43d6c89cbd772f76b7d405de4dd3b462 (patch)
tree31a80ad6958b46b33f8bea3553bd0681054dfbb2 /src/Entities/Boat.cpp
parentFix debug macro situation (#5114) (diff)
downloadcuberite-b1b7424c43d6c89cbd772f76b7d405de4dd3b462.tar
cuberite-b1b7424c43d6c89cbd772f76b7d405de4dd3b462.tar.gz
cuberite-b1b7424c43d6c89cbd772f76b7d405de4dd3b462.tar.bz2
cuberite-b1b7424c43d6c89cbd772f76b7d405de4dd3b462.tar.lz
cuberite-b1b7424c43d6c89cbd772f76b7d405de4dd3b462.tar.xz
cuberite-b1b7424c43d6c89cbd772f76b7d405de4dd3b462.tar.zst
cuberite-b1b7424c43d6c89cbd772f76b7d405de4dd3b462.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Boat.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Entities/Boat.cpp b/src/Entities/Boat.cpp
index 4400cd4c0..cc11643fd 100644
--- a/src/Entities/Boat.cpp
+++ b/src/Entities/Boat.cpp
@@ -75,6 +75,16 @@ bool cBoat::DoTakeDamage(TakeDamageInfo & TDI)
m_World->BroadcastEntityMetadata(*this);
+ if ((TDI.Attacker != nullptr) && (TDI.Attacker->IsPlayer()))
+ {
+ cPlayer * Destroyer = static_cast<cPlayer *>(TDI.Attacker);
+ if (Destroyer->IsGameModeCreative())
+ {
+ Destroy();
+ return true;
+ }
+ }
+
if (GetHealth() <= 0)
{
if (TDI.Attacker != nullptr)