summaryrefslogtreecommitdiffstats
path: root/src/Mobs/AggressiveMonster.cpp
diff options
context:
space:
mode:
authorbibo38 <bibo38@users.noreply.github.com>2016-10-12 14:38:45 +0200
committerMattes D <github@xoft.cz>2016-10-12 14:38:45 +0200
commitcb640ffea4a51a10db2e379ada8dc0487378ba09 (patch)
tree780ff243f439c9663b2f88e5df2805cc503f4f1d /src/Mobs/AggressiveMonster.cpp
parentFixed cProjectileEntity double destroy bug (#3397) (diff)
downloadcuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.gz
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.bz2
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.lz
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.xz
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.zst
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/AggressiveMonster.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Mobs/AggressiveMonster.cpp b/src/Mobs/AggressiveMonster.cpp
index 109ad274c..d8bdc4af5 100644
--- a/src/Mobs/AggressiveMonster.cpp
+++ b/src/Mobs/AggressiveMonster.cpp
@@ -36,13 +36,16 @@ void cAggressiveMonster::InStateChasing(std::chrono::milliseconds a_Dt, cChunk &
-void cAggressiveMonster::EventSeePlayer(cEntity * a_Entity, cChunk & a_Chunk)
+
+void cAggressiveMonster::EventSeePlayer(cPlayer * a_Player, cChunk & a_Chunk)
{
- if (!static_cast<cPlayer *>(a_Entity)->IsGameModeCreative())
+ if (!a_Player->CanMobsTarget())
{
- super::EventSeePlayer(a_Entity, a_Chunk);
- m_EMState = CHASING;
+ return;
}
+
+ super::EventSeePlayer(a_Player, a_Chunk);
+ m_EMState = CHASING;
}