summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 10:29:29 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-30 10:29:29 +0200
commit7f7c743204bb7fddfd439bcfa84943ba0fe31755 (patch)
treeacd72b62c5bc33dbb45b9ac1b5853f9970d7a45c
parenttargetStrikeRange (diff)
downloadcuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.gz
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.bz2
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.lz
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.xz
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.tar.zst
cuberite-7f7c743204bb7fddfd439bcfa84943ba0fe31755.zip
-rw-r--r--src/ClientHandle.cpp2
-rw-r--r--src/Entities/Entity.cpp6
-rw-r--r--src/Entities/Pawn.cpp52
-rw-r--r--src/Entities/Pawn.h16
-rw-r--r--src/Entities/Player.cpp2
-rw-r--r--src/Mobs/Behaviors/BehaviorAggressive.cpp1
-rw-r--r--src/Mobs/Behaviors/BehaviorAttacker.cpp64
-rw-r--r--src/Mobs/Behaviors/BehaviorAttacker.h43
-rw-r--r--src/Mobs/Behaviors/BehaviorCoward.cpp2
-rw-r--r--src/Mobs/MobPointer.cpp7
-rw-r--r--src/Mobs/MobPointer.h3
-rw-r--r--src/Mobs/Monster.cpp2
-rw-r--r--src/Mobs/PassiveAggressiveMonster.cpp22
-rw-r--r--src/Mobs/PassiveAggressiveMonster.h8
-rw-r--r--src/Mobs/Sheep.cpp4
-rw-r--r--src/Mobs/Wolf.cpp14
-rw-r--r--src/MonsterConfig.cpp4
17 files changed, 93 insertions, 159 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index dbd6d4b4e..cd763b3e6 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -189,7 +189,7 @@ void cClientHandle::Destroy(void)
auto world = player->GetWorld();
if (world != nullptr)
{
- player->StopEveryoneFromTargetingMe();
+ // player->StopEveryoneFromTargetingMe(); // mobTodo
player->SetIsTicking(false);
if (WasAddedToWorld)
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index ccba28d53..c4fe1fffd 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1592,12 +1592,12 @@ bool cEntity::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d
// Stop all mobs from targeting this entity
// Stop this entity from targeting other mobs
- if (this->IsMob())
+ /* if (this->IsMob())
{
cMonster * Monster = static_cast<cMonster*>(this);
Monster->SetTarget(nullptr);
- Monster->StopEveryoneFromTargetingMe();
- }
+ Monster->StopEveryoneFromTargetingMe(); mobTodo MovingWorld event for all behaviors?
+ }*/
// Queue add to new world and removal from the old one
cWorld * OldWorld = GetWorld();
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 233cdfa85..0fa11997b 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -29,7 +29,7 @@ cPawn::cPawn(eEntityType a_EntityType, double a_Width, double a_Height) :
cPawn::~cPawn()
{
- ASSERT(m_TargetingMe.size() == 0);
+
}
@@ -38,7 +38,6 @@ cPawn::~cPawn()
void cPawn::Destroyed()
{
- StopEveryoneFromTargetingMe();
super::Destroyed();
}
@@ -260,38 +259,6 @@ void cPawn::ClearEntityEffects()
-void cPawn::NoLongerTargetingMe(cMonster * a_Monster)
-{
- ASSERT(IsTicking()); // Our destroy override is supposed to clear all targets before we're destroyed.
- for (auto i = m_TargetingMe.begin(); i != m_TargetingMe.end(); ++i)
- {
- cMonster * Monster = *i;
- if (Monster == a_Monster)
- {
- ASSERT(Monster->GetTarget() != this); // The monster is notifying us it is no longer targeting us, assert if that's a lie
- m_TargetingMe.erase(i);
- return;
- }
- }
- ASSERT(false); // If this happens, something is wrong. Perhaps the monster never called TargetingMe() or called NoLongerTargetingMe() twice.
-}
-
-
-
-
-
-void cPawn::TargetingMe(cMonster * a_Monster)
-{
- ASSERT(IsTicking());
- ASSERT(m_TargetingMe.size() < 10000);
- ASSERT(a_Monster->GetTarget() == this);
- m_TargetingMe.push_back(a_Monster);
-}
-
-
-
-
-
void cPawn::HandleFalling(void)
{
/* Not pretty looking, and is more suited to wherever server-sided collision detection is implemented.
@@ -462,23 +429,6 @@ void cPawn::HandleFalling(void)
-void cPawn::StopEveryoneFromTargetingMe()
-{
- std::vector<cMonster*>::iterator i = m_TargetingMe.begin();
- while (i != m_TargetingMe.end())
- {
- cMonster * Monster = *i;
- ASSERT(Monster->GetTarget() == this);
- Monster->UnsafeUnsetTarget();
- i = m_TargetingMe.erase(i);
- }
- ASSERT(m_TargetingMe.size() == 0);
-}
-
-
-
-
-
std::map<cEntityEffect::eType, cEntityEffect *> cPawn::GetEntityEffects()
{
std::map<cEntityEffect::eType, cEntityEffect *> Effects;
diff --git a/src/Entities/Pawn.h b/src/Entities/Pawn.h
index 480b523ea..935122012 100644
--- a/src/Entities/Pawn.h
+++ b/src/Entities/Pawn.h
@@ -33,11 +33,6 @@ public:
virtual void HandleAir(void) override;
virtual void HandleFalling(void);
- /** Tells all pawns which are targeting us to stop targeting us. */
- void StopEveryoneFromTargetingMe();
-
-
-
// tolua_begin
/** Applies an entity effect.
@@ -58,12 +53,6 @@ public:
// tolua_end
- /** Remove the monster from the list of monsters targeting this pawn. */
- void NoLongerTargetingMe(cMonster * a_Monster);
-
- /** Add the monster to the list of monsters targeting this pawn. (Does not check if already in list!) */
- void TargetingMe(cMonster * a_Monster);
-
/** Returns all entity effects */
std::map<cEntityEffect::eType, cEntityEffect *> GetEntityEffects();
@@ -76,11 +65,6 @@ protected:
double m_LastGroundHeight;
bool m_bTouchGround;
-
-private:
-
- /** A list of all monsters that are targeting this pawn. */
- std::vector<cMonster*> m_TargetingMe;
} ; // tolua_export
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index fb2274cad..4189841b8 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -2018,7 +2018,7 @@ bool cPlayer::DoMoveToWorld(cWorld * a_World, bool a_ShouldSendRespawn, Vector3d
FreezeInternal(a_NewPosition, false);
// Stop all mobs from targeting this player
- StopEveryoneFromTargetingMe();
+ // StopEveryoneFromTargetingMe(); // mobTodo
cClientHandle * ch = this->GetClientHandle();
if (ch != nullptr)
diff --git a/src/Mobs/Behaviors/BehaviorAggressive.cpp b/src/Mobs/Behaviors/BehaviorAggressive.cpp
index ccea67eb4..b55c1b476 100644
--- a/src/Mobs/Behaviors/BehaviorAggressive.cpp
+++ b/src/Mobs/Behaviors/BehaviorAggressive.cpp
@@ -34,5 +34,6 @@ void cBehaviorAggressive::PreTick(std::chrono::milliseconds a_Dt, cChunk & a_Chu
cPawn * cBehaviorAggressive::FindNewTarget()
{
cPlayer * Closest = m_Parent->GetNearestPlayer();
+ if (!Closest->CanMobsTarget()) return nullptr;
return Closest; // May be null
}
diff --git a/src/Mobs/Behaviors/BehaviorAttacker.cpp b/src/Mobs/Behaviors/BehaviorAttacker.cpp
index 56a879e84..3113516ff 100644
--- a/src/Mobs/Behaviors/BehaviorAttacker.cpp
+++ b/src/Mobs/Behaviors/BehaviorAttacker.cpp
@@ -15,6 +15,7 @@ cBehaviorAttacker::cBehaviorAttacker() :
, m_AttackRange(1)
, m_AttackCoolDownTicksLeft(0)
, m_TicksSinceLastDamaged(100)
+ , m_IsStriking(false)
{
}
@@ -26,7 +27,6 @@ cBehaviorAttacker::cBehaviorAttacker() :
void cBehaviorAttacker::AttachToMonster(cMonster & a_Parent, cBehaviorStriker & a_ParentStriker)
{
m_Parent = &a_Parent;
- m_ParentStriker = &a_ParentStriker;
m_Parent->AttachTickBehavior(this);
m_Parent->AttachDestroyBehavior(this);
m_Parent->AttachPostTickBehavior(this);
@@ -54,8 +54,13 @@ void cBehaviorAttacker::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
UNUSED(a_Dt);
UNUSED(a_Chunk);
- /*
- * if ((GetTarget() != nullptr))
+
+ if (m_IsStriking) return;
+ // If we're striking, return. This allows derived classes to implement multi-tick strikes
+ // E.g. a blaze shooting 3 fireballs in consequative ticks.
+ // Derived class is expected to set m_IsStriking to false when the strike is done.
+
+ if ((GetTarget() != nullptr))
{
ASSERT(GetTarget()->IsTicking());
@@ -66,8 +71,8 @@ void cBehaviorAttacker::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
SetTarget(nullptr);
}
}
- } //mobTodo copied from monster.cpp
- * */
+ }
+
ASSERT((GetTarget() == nullptr) || (GetTarget()->IsPawn() && (GetTarget()->GetWorld() == m_Parent->GetWorld())));
// Stop targeting out of range targets
@@ -79,24 +84,20 @@ void cBehaviorAttacker::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
}
else
{
- if (TargetIsInStrikeRange())
+ if (TargetIsInStrikeRadiusAndLineOfSight())
{
- StrikeTarget();
+ StrikeTargetIfReady();
}
else
{
- ApproachTarget(); // potential mobTodo: decoupling approaching from attacking
- // Not important now, but important for future extensibility, e.g.
- // cow chases wheat but using the netherman approacher to teleport around.
+ m_Parent->MoveToPosition(m_Target->GetPosition());
+ // todo BehaviorApproacher
}
}
}
}
-void cBehaviorAttacker::ApproachTarget()
-{
- m_Parent->MoveToPosition(m_Target->GetPosition());
-}
+
@@ -189,7 +190,17 @@ void cBehaviorAttacker::SetTarget(cPawn * a_Target)
-bool cBehaviorAttacker::TargetIsInStrikeRange()
+bool cBehaviorAttacker::TargetIsInStrikeRadius(void)
+{
+ ASSERT(GetTarget() != nullptr);
+ return ((GetTarget()->GetPosition() - m_Parent->GetPosition()).SqrLength() < (m_AttackRange * m_AttackRange));
+}
+
+
+
+
+
+bool cBehaviorAttacker::TargetIsInStrikeRadiusAndLineOfSight()
{
ASSERT(m_Target != nullptr);
ASSERT(m_Parent != nullptr);
@@ -199,13 +210,17 @@ bool cBehaviorAttacker::TargetIsInStrikeRange()
Vector3d MyHeadPosition = m_Parent->GetPosition() + Vector3d(0, m_Parent->GetHeight(), 0);
Vector3d AttackDirection(GetTarget()->GetPosition() + Vector3d(0, GetTarget()->GetHeight(), 0) - MyHeadPosition);
- if (TargetIsInRange() && !LineOfSight.Trace(MyHeadPosition, AttackDirection, static_cast<int>(AttackDirection.Length())) && (GetHealth() > 0.0))
+ if (TargetIsInStrikeRadius() &&
+ !LineOfSight.Trace(MyHeadPosition, AttackDirection, static_cast<int>(AttackDirection.Length())) &&
+ (m_Parent->GetHealth() > 0.0)
+ )
+ {
+ return true;
+ }
+ else
{
- // Attack if reached destination, target isn't null, and have a clear line of sight to target (so won't attack through walls)
- Attack(a_Dt);
+ return false;
}
-
- return ((m_Target->GetPosition() - m_Parent->GetPosition()).SqrLength() < (m_AttackRange * m_AttackRange));
}
@@ -235,15 +250,12 @@ void cBehaviorAttacker::ResetStrikeCooldown()
-void cBehaviorAttacker::StrikeTarget()
+void cBehaviorAttacker::StrikeTargetIfReady()
{
if (m_AttackCoolDownTicksLeft != 0)
{
- cBehaviorStriker * Striker = m_ParentStriker;
- if (Striker != nullptr)
- {
- // Striker->Strike(m_Target); //mobTodo
- }
+ m_IsStriking = true;
+ StrikeTarget(); // Different derived classes implement strikes in different ways
ResetStrikeCooldown();
}
}
diff --git a/src/Mobs/Behaviors/BehaviorAttacker.h b/src/Mobs/Behaviors/BehaviorAttacker.h
index 67592acba..4573f9a4a 100644
--- a/src/Mobs/Behaviors/BehaviorAttacker.h
+++ b/src/Mobs/Behaviors/BehaviorAttacker.h
@@ -17,39 +17,32 @@ public:
cBehaviorAttacker();
void AttachToMonster(cMonster & a_Parent, cBehaviorStriker & a_ParentStriker);
- // Functions our host Monster should invoke:
- bool IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
- void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
- void Destroyed() override;
- void PostTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
- void DoTakeDamage(TakeDamageInfo & a_TDI) override;
// Our host monster will call these once it loads its config file
void SetAttackRate(float a_AttackRate);
void SetAttackRange(int a_AttackRange);
void SetAttackDamage(int a_AttackDamage);
+ // Behavior functions
+ virtual bool IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
+ virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
+ void Destroyed() override;
+ virtual void PostTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
+ void DoTakeDamage(TakeDamageInfo & a_TDI) override;
+
/** Returns the target pointer, or a nullptr if we're not targeting anyone. */
cPawn * GetTarget();
- /** Sets the target. */
+ /** Sets a new target. Forgets the older target if present. */
void SetTarget(cPawn * a_Target);
protected:
- void ApproachTarget();
- // virtual void ApproachTarget() = 0; //mobTodo
-private:
+ virtual void StrikeTarget() = 0;
- /** Our parent */
- cMonster * m_Parent;
- cBehaviorStriker * m_ParentStriker;
-
- // The mob we want to attack
- cPawn * m_Target;
-
- // Target stuff
- bool TargetIsInStrikeRange();
+ // Target related methods
+ bool TargetIsInStrikeRadius();
+ bool TargetIsInStrikeRadiusAndLineOfSight();
bool TargetOutOfSight();
- void StrikeTarget();
+ void StrikeTargetIfReady();
// Cooldown stuff
void ResetStrikeCooldown();
@@ -61,4 +54,14 @@ private:
int m_AttackCoolDownTicksLeft;
int m_TicksSinceLastDamaged; // How many ticks ago were we last damaged by a player?
+
+ bool m_IsStriking;
+private:
+
+ /** Our parent */
+ cMonster * m_Parent;
+
+ // The mob we want to attack
+ cPawn * m_Target;
+
};
diff --git a/src/Mobs/Behaviors/BehaviorCoward.cpp b/src/Mobs/Behaviors/BehaviorCoward.cpp
index c2c59a633..132735e0f 100644
--- a/src/Mobs/Behaviors/BehaviorCoward.cpp
+++ b/src/Mobs/Behaviors/BehaviorCoward.cpp
@@ -16,7 +16,6 @@ cBehaviorCoward::cBehaviorCoward() :
void cBehaviorCoward::AttachToMonster(cMonster & a_Parent)
{
- LOGD("mobDebug - Behavior Coward: Attach");
m_Parent = &a_Parent;
m_Parent->AttachTickBehavior(this);
m_Parent->AttachDoTakeDamageBehavior(this);
@@ -87,7 +86,6 @@ void cBehaviorCoward::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
void cBehaviorCoward::DoTakeDamage(TakeDamageInfo & a_TDI)
{
- LOGD("mobDebug - Behavior Coward: DoTakeDamage");
if ((a_TDI.Attacker != m_Parent) && (a_TDI.Attacker != nullptr))
{
m_Attacker = a_TDI.Attacker;
diff --git a/src/Mobs/MobPointer.cpp b/src/Mobs/MobPointer.cpp
index b755e3cdf..6e3bccee1 100644
--- a/src/Mobs/MobPointer.cpp
+++ b/src/Mobs/MobPointer.cpp
@@ -1,5 +1,8 @@
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+
#include "../Entities/Pawn.h"
#include "MobPointer.h"
+#include "../World.h"
cMobPointer::cMobPointer(cPawn * a_Pointer) : m_Pointer(a_Pointer)
{
@@ -62,11 +65,11 @@ void cMobPointer::operator=(cPawn * a_Pointer)
-cPawn * cMobPointer::GetPointer()
+cPawn * cMobPointer::GetPointer(cWorld * a_CurrentWorld)
{
if (m_Pointer != nullptr)
{
- if (!m_Pointer->IsTicking())
+ if (!m_Pointer->IsTicking() || (m_Pointer->GetWorld() != a_CurrentWorld))
{
m_Pointer = nullptr;
}
diff --git a/src/Mobs/MobPointer.h b/src/Mobs/MobPointer.h
index 109b0511e..77f4cd6cd 100644
--- a/src/Mobs/MobPointer.h
+++ b/src/Mobs/MobPointer.h
@@ -7,6 +7,7 @@ it MUST NOT be preserved across ticks.
*/
class cPawn;
+class cWorld;
class cMobPointer
{
public:
@@ -22,7 +23,7 @@ public:
be used locally and then discarded. it MUST NOT be preserved across ticks.
Returns null if raw pointer is null. Returns null if mob is destroyed or moved worlds.
Must be called at least once per tick, even if the raw pointer is not going to be used that tick. */
- cPawn * GetPointer();
+ cPawn * GetPointer(cWorld * a_CurrentWorld);
private:
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 013a14953..0e0197e3d 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -518,7 +518,7 @@ void cMonster::CalcLeashActions()
void cMonster::SetPitchAndYawFromDestination(bool a_IsFollowingPath)
{
Vector3d BodyDistance;
- cPawn * LookingAt = m_LookingAt.GetPointer();
+ cPawn * LookingAt = m_LookingAt.GetPointer(GetWorld());
if (!a_IsFollowingPath && (LookingAt != nullptr))
{
BodyDistance = LookingAt->GetPosition() - GetPosition();
diff --git a/src/Mobs/PassiveAggressiveMonster.cpp b/src/Mobs/PassiveAggressiveMonster.cpp
index addde27a7..28f45994c 100644
--- a/src/Mobs/PassiveAggressiveMonster.cpp
+++ b/src/Mobs/PassiveAggressiveMonster.cpp
@@ -14,25 +14,3 @@ cPassiveAggressiveMonster::cPassiveAggressiveMonster(const AString & a_ConfigNam
{
m_EMPersonality = PASSIVE;
}
-
-
-
-
-
-bool cPassiveAggressiveMonster::DoTakeDamage(TakeDamageInfo & a_TDI)
-{
- if (!super::DoTakeDamage(a_TDI))
- {
- return false;
- }
-
- // mobtodo remove this class altogether
- if ((GetTarget() != nullptr) && (GetTarget()->IsPlayer()))
- {
- if (static_cast<cPlayer *>(GetTarget())->CanMobsTarget())
- {
- // m_EMState = CHASING;
- }
- }
- return true;
-}
diff --git a/src/Mobs/PassiveAggressiveMonster.h b/src/Mobs/PassiveAggressiveMonster.h
index 726db09c5..8a45bcfb1 100644
--- a/src/Mobs/PassiveAggressiveMonster.h
+++ b/src/Mobs/PassiveAggressiveMonster.h
@@ -8,14 +8,12 @@
class cPassiveAggressiveMonster :
- public cAggressiveMonster
+ public cAggressiveMonster
{
- typedef cAggressiveMonster super;
+ typedef cAggressiveMonster super;
public:
- cPassiveAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);
-
- virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
+ cPassiveAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);
} ;
diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp
index ae06a0055..cca3b944f 100644
--- a/src/Mobs/Sheep.cpp
+++ b/src/Mobs/Sheep.cpp
@@ -13,9 +13,9 @@
cSheep::cSheep(int a_Color) :
super("Sheep", mtSheep, "entity.sheep.hurt", "entity.sheep.death", 0.6, 1.3),
+ m_TimeToStopEating(-1),
m_IsSheared(false),
- m_WoolColor(a_Color),
- m_TimeToStopEating(-1)
+ m_WoolColor(a_Color)
{
m_EMPersonality = PASSIVE;
m_BehaviorBreeder.AttachToMonster(*this);
diff --git a/src/Mobs/Wolf.cpp b/src/Mobs/Wolf.cpp
index 243507855..f57832c92 100644
--- a/src/Mobs/Wolf.cpp
+++ b/src/Mobs/Wolf.cpp
@@ -30,6 +30,7 @@ cWolf::cWolf(void) :
bool cWolf::DoTakeDamage(TakeDamageInfo & a_TDI)
{
+ /*
cPawn * PreviousTarget = GetTarget();
if (!super::DoTakeDamage(a_TDI))
{
@@ -66,7 +67,7 @@ bool cWolf::DoTakeDamage(TakeDamageInfo & a_TDI)
}
m_World->BroadcastEntityMetadata(*this); // Broadcast health and possibly angry face
- return true;
+ return true;*/
}
@@ -75,6 +76,7 @@ bool cWolf::DoTakeDamage(TakeDamageInfo & a_TDI)
void cWolf::NotifyAlliesOfFight(cPawn * a_Opponent)
{
+ /*
if (GetOwnerName() == "")
{
return;
@@ -92,7 +94,7 @@ void cWolf::NotifyAlliesOfFight(cPawn * a_Opponent)
} Callback;
Callback.m_Opponent = a_Opponent;
- m_World->DoWithPlayerByUUID(m_OwnerUUID, Callback);
+ m_World->DoWithPlayerByUUID(m_OwnerUUID, Callback);*/
}
/*bool cWolf::Attack(std::chrono::milliseconds a_Dt)
@@ -119,6 +121,7 @@ void cWolf::NotifyAlliesOfFight(cPawn * a_Opponent)
void cWolf::ReceiveNearbyFightInfo(const cUUID & a_PlayerID, cPawn * a_Opponent, bool a_IsPlayerInvolved)
{
+ /*
if (
(a_Opponent == nullptr) || IsSitting() || (!IsTame()) ||
(!a_Opponent->IsPawn()) || (a_PlayerID != m_OwnerUUID)
@@ -159,7 +162,7 @@ void cWolf::ReceiveNearbyFightInfo(const cUUID & a_PlayerID, cPawn * a_Opponent,
}
SetTarget(a_Opponent);
-
+ */
}
@@ -169,7 +172,7 @@ void cWolf::ReceiveNearbyFightInfo(const cUUID & a_PlayerID, cPawn * a_Opponent,
void cWolf::OnRightClicked(cPlayer & a_Player)
{
- const cItem & EquippedItem = a_Player.GetEquippedItem();
+ /*const cItem & EquippedItem = a_Player.GetEquippedItem();
const int EquippedItemType = EquippedItem.m_ItemType;
if (!IsTame() && !IsAngry())
@@ -245,6 +248,7 @@ void cWolf::OnRightClicked(cPlayer & a_Player)
}
m_World->BroadcastEntityMetadata(*this);
+ */
}
@@ -351,6 +355,7 @@ void cWolf::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
void cWolf::TickFollowPlayer()
{
+ /*
class cCallback :
public cPlayerListCallback
{
@@ -396,6 +401,7 @@ void cWolf::TickFollowPlayer()
}
}
}
+ */
}
diff --git a/src/MonsterConfig.cpp b/src/MonsterConfig.cpp
index 3c86903e9..78761aa2d 100644
--- a/src/MonsterConfig.cpp
+++ b/src/MonsterConfig.cpp
@@ -3,7 +3,7 @@
#include "MonsterConfig.h"
#include "Mobs/Monster.h"
-#include "Mobs/Behaviors/BehaviorChaser.h"
+#include "Mobs/Behaviors/BehaviorAttacker.h"
#include "IniFile.h"
@@ -91,7 +91,7 @@ void cMonsterConfig::AssignAttributes(cMonster * a_Monster, const AString & a_Na
{
if (itr->m_Name.compare(a_Name) == 0)
{
- cBehaviorAttacker * Chaser = a_Monster->GetBehaviorChaser();
+ cBehaviorAttacker * Chaser = a_Monster->GetBehaviorAttacker();
// mobTodo chaser is kind of "attacker", not really chaser?
if (Chaser != nullptr)