summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-08-22 16:41:48 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-08-22 19:55:30 +0200
commit9711b06578e25fb92c8e6d10bd0f12bf593ed9db (patch)
treeb84d626e2216dc4010eef3060c950cc43c560e9e /src/Mobs/Monster.cpp
parentd (diff)
downloadcuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.gz
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.bz2
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.lz
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.xz
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.tar.zst
cuberite-9711b06578e25fb92c8e6d10bd0f12bf593ed9db.zip
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r--src/Mobs/Monster.cpp44
1 files changed, 11 insertions, 33 deletions
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: