summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorRorkh <78957156+Rorkh@users.noreply.github.com>2021-07-28 22:51:59 +0200
committerGitHub <noreply@github.com>2021-07-28 22:51:59 +0200
commit4221e08f3a76dbb1ca2321f58a893b5662d772f4 (patch)
treee107fef78a5960f589ab120f8ea5f63da7ae5617 /src/Entities/Entity.cpp
parentUpdate to mybed 3.0.0 (#5275) (diff)
downloadcuberite-4221e08f3a76dbb1ca2321f58a893b5662d772f4.tar
cuberite-4221e08f3a76dbb1ca2321f58a893b5662d772f4.tar.gz
cuberite-4221e08f3a76dbb1ca2321f58a893b5662d772f4.tar.bz2
cuberite-4221e08f3a76dbb1ca2321f58a893b5662d772f4.tar.lz
cuberite-4221e08f3a76dbb1ca2321f58a893b5662d772f4.tar.xz
cuberite-4221e08f3a76dbb1ca2321f58a893b5662d772f4.tar.zst
cuberite-4221e08f3a76dbb1ca2321f58a893b5662d772f4.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Entity.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index aada520f7..e9605fe5a 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -390,6 +390,18 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
return false;
}
+ if (IsPainting())
+ {
+ KilledBy(a_TDI);
+
+ if (a_TDI.Attacker != nullptr)
+ {
+ a_TDI.Attacker->Killed(this);
+ }
+
+ return true;
+ }
+
if ((a_TDI.Attacker != nullptr) && (a_TDI.Attacker->IsPlayer()))
{
cPlayer * Player = static_cast<cPlayer *>(a_TDI.Attacker);