From 4e5baf3f39c6972fb525b0d4aed58f59de3005bd Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Thu, 24 Aug 2017 10:25:50 +0300 Subject: pass a_Dt and a_Chunk to PostTick,PreTick,Tick,IsControlDesired --- src/Mobs/Behaviors/BehaviorAggressive.cpp | 2 +- src/Mobs/Behaviors/BehaviorBreeder.cpp | 12 +++++++++--- src/Mobs/Behaviors/BehaviorChaser.cpp | 10 +++++++--- src/Mobs/Behaviors/BehaviorCoward.cpp | 8 ++++++-- src/Mobs/Behaviors/BehaviorDayLightBurner.cpp | 2 ++ src/Mobs/Behaviors/BehaviorItemFollower.cpp | 8 ++++++-- 6 files changed, 31 insertions(+), 11 deletions(-) (limited to 'src/Mobs/Behaviors') diff --git a/src/Mobs/Behaviors/BehaviorAggressive.cpp b/src/Mobs/Behaviors/BehaviorAggressive.cpp index d629d83ac..f7c553f52 100644 --- a/src/Mobs/Behaviors/BehaviorAggressive.cpp +++ b/src/Mobs/Behaviors/BehaviorAggressive.cpp @@ -19,7 +19,7 @@ cBehaviorAggressive::cBehaviorAggressive(cMonster * a_Parent) : m_Parent(a_Paren -void cBehaviorAggressive::PreTick() +void cBehaviorAggressive::PreTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { // Target something new if we have no target if (m_ParentChaser->GetTarget() == nullptr) diff --git a/src/Mobs/Behaviors/BehaviorBreeder.cpp b/src/Mobs/Behaviors/BehaviorBreeder.cpp index 219846367..b2bd8da5d 100644 --- a/src/Mobs/Behaviors/BehaviorBreeder.cpp +++ b/src/Mobs/Behaviors/BehaviorBreeder.cpp @@ -24,8 +24,10 @@ cBehaviorBreeder::cBehaviorBreeder(cMonster * a_Parent) : -void cBehaviorBreeder::Tick() +void cBehaviorBreeder::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { + UNUSED(a_Dt); + UNUSED(a_Chunk); cWorld * World = m_Parent->GetWorld(); // if we have a partner, mate if (m_LovePartner != nullptr) @@ -74,8 +76,10 @@ void cBehaviorBreeder::Tick() -void cBehaviorBreeder::PostTick() +void cBehaviorBreeder::PostTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { + UNUSED(a_Dt); + UNUSED(a_Chunk); if (m_MatingTimer > 0) { m_MatingTimer--; @@ -94,8 +98,10 @@ void cBehaviorBreeder::PostTick() -bool cBehaviorBreeder::IsControlDesired() +bool cBehaviorBreeder::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { + UNUSED(a_Dt); + UNUSED(a_Chunk); cWorld * World = m_Parent->GetWorld(); // if we have a love partner, we should control the mob diff --git a/src/Mobs/Behaviors/BehaviorChaser.cpp b/src/Mobs/Behaviors/BehaviorChaser.cpp index c486c049a..025c60dd0 100644 --- a/src/Mobs/Behaviors/BehaviorChaser.cpp +++ b/src/Mobs/Behaviors/BehaviorChaser.cpp @@ -23,8 +23,10 @@ cBehaviorChaser::cBehaviorChaser(cMonster * a_Parent) : -bool cBehaviorChaser::IsControlDesired() +bool cBehaviorChaser::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { + UNUSED(a_Dt); + UNUSED(a_Chunk); // If we have a target, we have something to do! Return true and control the mob Ticks. // Otherwise return false. return (GetTarget() != nullptr); @@ -34,8 +36,10 @@ bool cBehaviorChaser::IsControlDesired() -void cBehaviorChaser::Tick() +void cBehaviorChaser::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { + UNUSED(a_Dt); + UNUSED(a_Chunk); /* * if ((GetTarget() != nullptr)) { @@ -83,7 +87,7 @@ void cBehaviorChaser::ApproachTarget() -void cBehaviorChaser::PostTick() +void cBehaviorChaser::PostTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { if (m_TicksSinceLastDamaged < 100) { diff --git a/src/Mobs/Behaviors/BehaviorCoward.cpp b/src/Mobs/Behaviors/BehaviorCoward.cpp index 31927a5e8..43be5c49c 100644 --- a/src/Mobs/Behaviors/BehaviorCoward.cpp +++ b/src/Mobs/Behaviors/BehaviorCoward.cpp @@ -16,8 +16,10 @@ cBehaviorCoward::cBehaviorCoward(cMonster * a_Parent) : -bool cBehaviorCoward::IsControlDesired() +bool cBehaviorCoward::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { + UNUSED(a_Dt); + UNUSED(a_Chunk); return (m_Attacker != nullptr); //mobTodo probably not so safe pointer (and cChaser m_Target too) } @@ -25,8 +27,10 @@ bool cBehaviorCoward::IsControlDesired() -void cBehaviorCoward::Tick() +void cBehaviorCoward::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { + UNUSED(a_Dt); + UNUSED(a_Chunk); if (m_Attacker == nullptr) { return; diff --git a/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp b/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp index 81307f36a..b28c3c49c 100644 --- a/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp +++ b/src/Mobs/Behaviors/BehaviorDayLightBurner.cpp @@ -15,6 +15,8 @@ cBehaviorDayLightBurner::cBehaviorDayLightBurner(cMonster * a_Parent) : m_Parent void cBehaviorDayLightBurner::PostTick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { // mobTodo WouldBurn + bool WouldBurn = false; // TEMP + int RelY = static_cast(m_Parent->GetPosY()); if ((RelY < 0) || (RelY >= cChunkDef::Height)) { diff --git a/src/Mobs/Behaviors/BehaviorItemFollower.cpp b/src/Mobs/Behaviors/BehaviorItemFollower.cpp index 22c20d6b4..c6cb0df04 100644 --- a/src/Mobs/Behaviors/BehaviorItemFollower.cpp +++ b/src/Mobs/Behaviors/BehaviorItemFollower.cpp @@ -17,8 +17,10 @@ cBehaviorItemFollower::cBehaviorItemFollower(cMonster * a_Parent) : -bool cBehaviorItemFollower::IsControlDesired() +bool cBehaviorItemFollower::IsControlDesired(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { + UNUSED(a_Dt); + UNUSED(a_Chunk); cItems FollowedItems; m_Parent->GetFollowedItems(FollowedItems); if (FollowedItems.Size() > 0) @@ -40,8 +42,10 @@ bool cBehaviorItemFollower::IsControlDesired() -void cBehaviorItemFollower::Tick() +void cBehaviorItemFollower::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { + UNUSED(a_Dt); + UNUSED(a_Chunk); cItems FollowedItems; m_Parent->GetFollowedItems(FollowedItems); if (FollowedItems.Size() > 0) -- cgit v1.2.3