limiting spawn list write lock further
This commit is contained in:
parent
8f47a27b1d
commit
9ef48d3bab
@ -4707,7 +4707,7 @@ int EQ2Emu_lua_Harvest(lua_State* state) {
|
||||
((GroundSpawn*)node)->ProcessHarvest(client);
|
||||
if (((GroundSpawn*)node)->GetNumberHarvests() == 0) {
|
||||
LuaSpell* spell = lua_interface->GetCurrentSpell(state);
|
||||
player->GetZone()->RemoveSpawn(node, true, true, true, true, (spell != nullptr) ? false : true);
|
||||
player->GetZone()->RemoveSpawn(node, true, true, true, false, (spell != nullptr) ? false : true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1515,8 +1515,8 @@ void ZoneServer::DeleteSpawns(bool delete_all) {
|
||||
|
||||
// Prepare a list of entries we’ll need to keep around
|
||||
std::vector<std::pair<Spawn*,int32>> to_keep;
|
||||
if(to_process.size() > 0) {
|
||||
to_keep.reserve(to_process.size());
|
||||
|
||||
int32 current_time = Timer::GetCurrentTime2();
|
||||
MSpawnList.writelock(__FUNCTION__, __LINE__);
|
||||
for (auto &entry : to_process) {
|
||||
@ -1575,6 +1575,7 @@ void ZoneServer::DeleteSpawns(bool delete_all) {
|
||||
safe_delete(spawn);
|
||||
}
|
||||
MSpawnList.releasewritelock(__FUNCTION__, __LINE__);
|
||||
}
|
||||
|
||||
// Add all the kept entries
|
||||
if (!to_keep.empty()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user