additional deadlock changes
Continued changes for deadlock issue. Fixes #31.
This commit is contained in:
parent
9893832bd3
commit
285a8aa591
3 changed files with 10 additions and 6 deletions
|
@ -3351,7 +3351,7 @@ int EQ2Emu_lua_Harvest(lua_State* state){
|
|||
|
||||
((GroundSpawn*)node)->ProcessHarvest(client);
|
||||
if(((GroundSpawn*)node)->GetNumberHarvests() == 0)
|
||||
player->GetZone()->RemoveSpawn(false, node, true);
|
||||
player->GetZone()->RemoveSpawn(true, node, true);
|
||||
}
|
||||
}
|
||||
else if(player && player->IsPlayer()){
|
||||
|
|
|
@ -3483,12 +3483,16 @@ Spawn* ZoneServer::GetSpawnByDatabaseID(int32 id){
|
|||
return ret;
|
||||
}
|
||||
|
||||
Spawn* ZoneServer::GetSpawnByID(int32 id) {
|
||||
Spawn* ZoneServer::GetSpawnByID(int32 id, bool spawnListLocked) {
|
||||
Spawn* ret = 0;
|
||||
MSpawnList.readlock(__FUNCTION__, __LINE__);
|
||||
if (!spawnListLocked )
|
||||
MSpawnList.readlock(__FUNCTION__, __LINE__);
|
||||
|
||||
if (spawn_list.count(id) > 0)
|
||||
ret = spawn_list[id];
|
||||
MSpawnList.releasereadlock(__FUNCTION__, __LINE__);
|
||||
|
||||
if (!spawnListLocked)
|
||||
MSpawnList.releasereadlock(__FUNCTION__, __LINE__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -4124,7 +4128,7 @@ void ZoneServer::KillSpawn(bool spawnListLocked, Spawn* dead, Spawn* killer, boo
|
|||
|
||||
|
||||
for (int8 i = 0; i < encounter->size(); i++) {
|
||||
spawn = GetSpawnByID(encounter->at(i));
|
||||
spawn = GetSpawnByID(encounter->at(i),spawnListLocked);
|
||||
// set a flag to let us know if the killer is in the encounter
|
||||
if (!killer_in_encounter && spawn == killer)
|
||||
killer_in_encounter = true;
|
||||
|
|
|
@ -280,7 +280,7 @@ public:
|
|||
void HandleEmote(Client* originator, string name);
|
||||
Client* GetClientBySpawn(Spawn* spawn);
|
||||
Spawn* GetSpawnByDatabaseID(int32 id);
|
||||
Spawn* GetSpawnByID(int32 id);
|
||||
Spawn* GetSpawnByID(int32 id, bool spawnListLocked=false);
|
||||
|
||||
void PlaySoundFile(Client* client, const char* name, float origin_x, float origin_y, float origin_z);
|
||||
void SendZoneSpawns(Client* client);
|
||||
|
|
Loading…
Reference in a new issue