summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Defines.h1
-rw-r--r--src/Items/ItemPumpkin.h2
-rw-r--r--src/Mobs/Enderman.cpp4
-rw-r--r--src/Mobs/SnowGolem.cpp2
4 files changed, 5 insertions, 4 deletions
diff --git a/src/Defines.h b/src/Defines.h
index 42978e740..a9714c52f 100644
--- a/src/Defines.h
+++ b/src/Defines.h
@@ -273,6 +273,7 @@ enum eDamageType
dtEnderPearl, // Thrown an ender pearl, teleported by it
dtAdmin, // Damage applied by an admin command
dtExplosion, // Damage applied by an explosion
+ dtEnvironment, // Damage dealt to mobs from environment: enderman in rain, snow golem in desert
// Some common synonyms:
dtPawnAttack = dtAttack,
diff --git a/src/Items/ItemPumpkin.h b/src/Items/ItemPumpkin.h
index 33810b51f..897cba279 100644
--- a/src/Items/ItemPumpkin.h
+++ b/src/Items/ItemPumpkin.h
@@ -82,7 +82,7 @@ public:
bool TrySpawnSnowGolem(cWorld & a_World, cPlayer & a_Player, const Vector3i a_PumpkinPos)
{
ASSERT(a_PumpkinPos.y > 1);
- ASSERT(a_World.GetBlock(a_PumpkinPos.addedY(-1)) == E_BLOCK_SNOW);
+ ASSERT(a_World.GetBlock(a_PumpkinPos.addedY(-1)) == E_BLOCK_SNOW_BLOCK);
// Need one more snow block 2 blocks below the pumpkin:
if (a_World.GetBlock(a_PumpkinPos.addedY(-2)) != E_BLOCK_SNOW_BLOCK)
diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp
index aa7c00bdd..3b8cd77e5 100644
--- a/src/Mobs/Enderman.cpp
+++ b/src/Mobs/Enderman.cpp
@@ -159,14 +159,14 @@ void cEnderman::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
return;
}
- // Take damage when wet, drowning damage seems to be most appropriate
+ // Take damage when wet
if (
cChunkDef::IsValidHeight(POSY_TOINT) &&
(GetWorld()->IsWeatherWetAtXYZ(GetPosition().Floor()) || IsInWater())
)
{
EventLosePlayer();
- TakeDamage(dtDrowning, nullptr, 1, 0);
+ TakeDamage(dtEnvironment, nullptr, 1, 0);
// TODO teleport to a safe location
}
}
diff --git a/src/Mobs/SnowGolem.cpp b/src/Mobs/SnowGolem.cpp
index 2e6d5ea09..93c29cafb 100644
--- a/src/Mobs/SnowGolem.cpp
+++ b/src/Mobs/SnowGolem.cpp
@@ -38,7 +38,7 @@ void cSnowGolem::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
}
if (IsBiomeNoDownfall(m_World->GetBiomeAt(POSX_TOINT, POSZ_TOINT)))
{
- TakeDamage(*this);
+ TakeDamage(dtEnvironment, nullptr, GetRawDamageAgainst(*this), GetKnockbackAmountAgainst(*this));
}
else
{