diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-24 09:14:42 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-08-24 09:14:42 +0200 |
commit | 3cbb05a941f449a393d11596060ecb5bc4f2b737 (patch) | |
tree | 51edc920952cc53dfbb467b63e23b20e31beb46d /src/Mobs/Behaviors/BehaviorChaser.cpp | |
parent | Everything now inherits Behavior.h (diff) | |
download | cuberite-3cbb05a941f449a393d11596060ecb5bc4f2b737.tar cuberite-3cbb05a941f449a393d11596060ecb5bc4f2b737.tar.gz cuberite-3cbb05a941f449a393d11596060ecb5bc4f2b737.tar.bz2 cuberite-3cbb05a941f449a393d11596060ecb5bc4f2b737.tar.lz cuberite-3cbb05a941f449a393d11596060ecb5bc4f2b737.tar.xz cuberite-3cbb05a941f449a393d11596060ecb5bc4f2b737.tar.zst cuberite-3cbb05a941f449a393d11596060ecb5bc4f2b737.zip |
Diffstat (limited to 'src/Mobs/Behaviors/BehaviorChaser.cpp')
-rw-r--r-- | src/Mobs/Behaviors/BehaviorChaser.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Mobs/Behaviors/BehaviorChaser.cpp b/src/Mobs/Behaviors/BehaviorChaser.cpp index 71a50c55b..c486c049a 100644 --- a/src/Mobs/Behaviors/BehaviorChaser.cpp +++ b/src/Mobs/Behaviors/BehaviorChaser.cpp @@ -36,6 +36,21 @@ bool cBehaviorChaser::IsControlDesired() void cBehaviorChaser::Tick() { + /* + * if ((GetTarget() != nullptr)) + { + ASSERT(GetTarget()->IsTicking()); + + if (GetTarget()->IsPlayer()) + { + if (!static_cast<cPlayer *>(GetTarget())->CanMobsTarget()) + { + SetTarget(nullptr); + } + } + } //mobTodo copied from monster.cpp + * */ + ASSERT((GetTarget() == nullptr) || (GetTarget()->IsPawn() && (GetTarget()->GetWorld() == m_Parent->GetWorld()))); // Stop targeting out of range targets if (GetTarget() != nullptr) |