diff options
author | Simerson <66266021+Simerson@users.noreply.github.com> | 2021-01-28 23:39:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 23:39:40 +0100 |
commit | b1b7424c43d6c89cbd772f76b7d405de4dd3b462 (patch) | |
tree | 31a80ad6958b46b33f8bea3553bd0681054dfbb2 /src | |
parent | Fix debug macro situation (#5114) (diff) | |
download | cuberite-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 'src')
-rw-r--r-- | src/Entities/Boat.cpp | 10 |
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) |