diff options
Diffstat (limited to 'src/Mobs/AggressiveMonster.cpp')
-rw-r--r-- | src/Mobs/AggressiveMonster.cpp | 11 |
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; } |