fix: don't call onmobdamage with null damage
This commit is contained in:
@@ -229,7 +229,8 @@ void IceTower::tick(std::uint64_t delta, World* world) {
|
||||
for (MobPtr mob : world->getMobList()) {
|
||||
if (isMobInRange(mob)) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user