fix AOE crash

This commit is contained in:
Emagi 2022-12-28 17:22:53 -05:00
parent 3f34a0f3b1
commit 47c34bf246

View file

@ -8558,12 +8558,12 @@ std::vector<Spawn*> ZoneServer::GetSpawnsInGrid(int32 grid_id) {
std::shared_lock lock(MGridMaps);
std::map<int32, GridMap*>::iterator grids = grid_maps.find(grid_id);
if(grids != grid_maps.end()) {
grids->second->MSpawns.lock_shared();
grids->second->MSpawns.lock();
typedef map <int32, Spawn*> SpawnMapType;
for( SpawnMapType::iterator it = grids->second->spawns.begin(); it != grids->second->spawns.end(); ++it ) {
ret.push_back( it->second );
}
grids->second->MSpawns.unlock_shared();
grids->second->MSpawns.unlock();
}
return ret;