From 9711b06578e25fb92c8e6d10bd0f12bf593ed9db Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Tue, 22 Aug 2017 17:41:48 +0300 Subject: d --- src/Mobs/Monster.cpp | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) (limited to 'src/Mobs/Monster.cpp') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index d02ea1809..fe2809f28 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -107,7 +107,6 @@ cMonster::cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const A , m_DropChanceBoots(0.085f) , m_CanPickUpLoot(true) , m_TicksSinceLastDamaged(100) - , m_BurnsInDaylight(false) , m_RelativeWalkSpeed(1) , m_Age(1) , m_AgingTimer(20 * 60 * 20) // about 20 minutes @@ -349,7 +348,7 @@ void cMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) 2. I was not hurt by a player recently. Then STOP. */ if ( - m_BurnsInDaylight && ((m_TicksSinceLastDamaged >= 100) || (m_EMState == IDLE)) && + (GetBehaviorDaylightBurner() != nullptr) && ((m_TicksSinceLastDamaged >= 100) || (m_EMState == IDLE)) && WouldBurnAt(m_NextWayPointPosition, *Chunk) && !WouldBurnAt(GetPosition(), *Chunk) ) @@ -1178,7 +1177,16 @@ cBehaviorWanderer * cMonster::GetBehaviorWanderer() -void cMonster::InheritFromParents(cPassiveMonster * a_Parent1, cPassiveMonster * a_Parent2) +cBehaviorWanderer * cMonster::GetBehaviorDaylightBurner() +{ + return nullptr; +} + + + + + +void cMonster::InheritFromParents(cMonster * a_Parent1, cMonster * a_Parent2) { UNUSED(a_Parent1); UNUSED(a_Parent2); @@ -1414,36 +1422,6 @@ void cMonster::AddRandomWeaponDropItem(cItems & a_Drops, unsigned int a_LootingL - -void cMonster::HandleDaylightBurning(cChunk & a_Chunk, bool WouldBurn) -{ - if (!m_BurnsInDaylight) - { - return; - } - - int RelY = POSY_TOINT; - if ((RelY < 0) || (RelY >= cChunkDef::Height)) - { - // Outside the world - return; - } - if (!a_Chunk.IsLightValid()) - { - m_World->QueueLightChunk(GetChunkX(), GetChunkZ()); - return; - } - - if (!IsOnFire() && WouldBurn) - { - // Burn for 100 ticks, then decide again - StartBurning(100); - } -} - - - - bool cMonster::WouldBurnAt(Vector3d a_Location, cChunk & a_Chunk) { // If the Y coord is out of range, return the most logical result without considering anything else: -- cgit v1.2.3