refactor: separate mob ans world listener

This commit is contained in:
2021-12-11 18:43:49 +01:00
parent a802b5cef5
commit 1474220a77
7 changed files with 38 additions and 21 deletions

View File

@@ -160,7 +160,7 @@ void ServerConnexion::HandlePacket(const protocol::PlaceTowerPacket* packet) {
game::TowerPtr tower = world->placeTowerAt(towerType, packet->getTowerX(), packet->getTowerY(), m_ID);
world->notifyListeners(&game::WorldListener::OnTowerAdd, tower);
world->getWorldNotifier().notifyListeners(&game::WorldListener::OnTowerAdd, tower);
protocol::WorldAddTowerPacket addTowerPacket(tower->getID(), packet->getTowerX(), packet->getTowerY(), packet->getTowerType(), m_ID);
m_Server->broadcastPacket(&addTowerPacket);