fix AOE crash
This commit is contained in:
parent
3f34a0f3b1
commit
47c34bf246
1 changed files with 2 additions and 2 deletions
|
@ -8558,12 +8558,12 @@ std::vector<Spawn*> ZoneServer::GetSpawnsInGrid(int32 grid_id) {
|
||||||
std::shared_lock lock(MGridMaps);
|
std::shared_lock lock(MGridMaps);
|
||||||
std::map<int32, GridMap*>::iterator grids = grid_maps.find(grid_id);
|
std::map<int32, GridMap*>::iterator grids = grid_maps.find(grid_id);
|
||||||
if(grids != grid_maps.end()) {
|
if(grids != grid_maps.end()) {
|
||||||
grids->second->MSpawns.lock_shared();
|
grids->second->MSpawns.lock();
|
||||||
typedef map <int32, Spawn*> SpawnMapType;
|
typedef map <int32, Spawn*> SpawnMapType;
|
||||||
for( SpawnMapType::iterator it = grids->second->spawns.begin(); it != grids->second->spawns.end(); ++it ) {
|
for( SpawnMapType::iterator it = grids->second->spawns.begin(); it != grids->second->spawns.end(); ++it ) {
|
||||||
ret.push_back( it->second );
|
ret.push_back( it->second );
|
||||||
}
|
}
|
||||||
grids->second->MSpawns.unlock_shared();
|
grids->second->MSpawns.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue