fix: send HeroDeletedEvent only if hero actually removed

This commit is contained in:
k0t9i 2023-10-16 17:51:11 +04:00
parent 2c475e69f3
commit b948273172

View File

@ -33,7 +33,7 @@ namespace Interlude
} }
result[hero->objectId] = m_Hero; result[hero->objectId] = m_Hero;
} }
else { else if (m_Hero) {
m_Hero = nullptr; m_Hero = nullptr;
EventDispatcher::GetInstance().Dispatch(HeroDeletedEvent{}); EventDispatcher::GetInstance().Dispatch(HeroDeletedEvent{});
} }