feat: add messaging system for manager and add example usage to Loot (#1837)

tested that loot still drops at the entities position
This commit is contained in:
David Markowitz
2025-06-29 00:22:41 -07:00
committed by GitHub
parent c697f8ad97
commit 48510b7315
22 changed files with 62 additions and 32 deletions

View File

@@ -605,3 +605,14 @@ void EntityManager::FireEventServerSide(Entity* origin, std::string args) {
bool EntityManager::IsExcludedFromGhosting(LOT lot) {
return std::find(m_GhostingExcludedLOTs.begin(), m_GhostingExcludedLOTs.end(), lot) != m_GhostingExcludedLOTs.end();
}
bool EntityManager::SendMessage(GameMessages::GameMsg& msg) const {
bool handled = false;
const auto entityItr = m_Entities.find(msg.target);
if (entityItr != m_Entities.end()) {
auto* const entity = entityItr->second;
if (entity) handled = entity->HandleMsg(msg);
}
return handled;
}