fix: don't call onmobdamage with null damage

This commit is contained in:
2021-11-30 18:45:09 +01:00
parent 93e079ddb3
commit 687944bf51

View File

@@ -229,7 +229,8 @@ void IceTower::tick(std::uint64_t delta, World* world) {
for (MobPtr mob : world->getMobList()) { for (MobPtr mob : world->getMobList()) {
if (isMobInRange(mob)) { if (isMobInRange(mob)) {
mob->addEffect(EffectType::Slowness, 1, this); // slowness for 1s every second mob->addEffect(EffectType::Slowness, 1, this); // slowness for 1s every second
world->notifyListeners(&WorldListener::OnMobDamage, mob, damage, this); if(damage > 0)
world->notifyListeners(&WorldListener::OnMobDamage, mob, damage, this);
m_Timer.applyCooldown(); m_Timer.applyCooldown();
} }
} }