summaryrefslogtreecommitdiffstats
path: root/src/Entities/ExpOrb.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2018-01-16 20:13:17 +0100
committerGitHub <noreply@github.com>2018-01-16 20:13:17 +0100
commit07619d932d703611c2e3e1296871bee5e27876b7 (patch)
treedde08d4291191409a8f5957efb0851290d686b92 /src/Entities/ExpOrb.cpp
parentDon't burn mobs in daylight when swimming (#4145) (diff)
downloadcuberite-07619d932d703611c2e3e1296871bee5e27876b7.tar
cuberite-07619d932d703611c2e3e1296871bee5e27876b7.tar.gz
cuberite-07619d932d703611c2e3e1296871bee5e27876b7.tar.bz2
cuberite-07619d932d703611c2e3e1296871bee5e27876b7.tar.lz
cuberite-07619d932d703611c2e3e1296871bee5e27876b7.tar.xz
cuberite-07619d932d703611c2e3e1296871bee5e27876b7.tar.zst
cuberite-07619d932d703611c2e3e1296871bee5e27876b7.zip
Diffstat (limited to 'src/Entities/ExpOrb.cpp')
-rw-r--r--src/Entities/ExpOrb.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Entities/ExpOrb.cpp b/src/Entities/ExpOrb.cpp
index 4ae847bf8..dd16a4762 100644
--- a/src/Entities/ExpOrb.cpp
+++ b/src/Entities/ExpOrb.cpp
@@ -46,6 +46,8 @@ void cExpOrb::SpawnOn(cClientHandle & a_Client)
void cExpOrb::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
+ DetectCacti();
+
// Check player proximity no more than twice per second
if ((m_TicksAlive % 10) == 0)
{
@@ -79,3 +81,14 @@ void cExpOrb::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
Destroy(true);
}
}
+
+bool cExpOrb::DoTakeDamage(TakeDamageInfo & a_TDI)
+{
+ if (a_TDI.DamageType == dtCactusContact)
+ {
+ Destroy(true);
+ return true;
+ }
+
+ return super::DoTakeDamage(a_TDI);
+}