use of SAFE_CHECK
This commit is contained in:
@@ -50,7 +50,9 @@ void WorldClient::HandlePacket(const protocol::SpawnMobPacket* packet) {
|
||||
|
||||
void WorldClient::HandlePacket(const protocol::UpgradeTowerPacket* packet) {
|
||||
game::TowerPtr tower = GetTowerById(packet->GetTowerID());
|
||||
if (tower == nullptr) return; // this should not happen but who knows ?
|
||||
|
||||
SAFE_CHECK(tower);
|
||||
|
||||
tower->Upgrade(packet->GetTowerLevel().GetLevel(), packet->GetTowerLevel().GetPath());
|
||||
}
|
||||
|
||||
@@ -63,9 +65,9 @@ void WorldClient::HandlePacket(const protocol::WorldAddTowerPacket* packet) {
|
||||
void WorldClient::HandlePacket(const protocol::RemoveTowerPacket* packet) {
|
||||
game::TowerPtr tower = RemoveTower(packet->GetTowerID());
|
||||
|
||||
if (tower != nullptr) {
|
||||
GetWorldNotifier().NotifyListeners(&WorldListener::OnTowerRemove, tower);
|
||||
}
|
||||
SAFE_CHECK(tower);
|
||||
|
||||
GetWorldNotifier().NotifyListeners(&WorldListener::OnTowerRemove, tower);
|
||||
}
|
||||
|
||||
void WorldClient::HandlePacket(const protocol::UpdateMobStatesPacket* packet) {
|
||||
|
||||
Reference in New Issue
Block a user