Skip to content

Commit

Permalink
[sd2_mr0569] add direct semaphore lock to ahn_quiraj instance (need c…
Browse files Browse the repository at this point in the history
…heck Win compile). related to #138
  • Loading branch information
rsa committed Mar 8, 2013
1 parent a20275f commit 38d9ee6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,21 @@ void instance_ruins_of_ahnqiraj::OnCreatureDeath(Creature* pCreature)
if (GetData(TYPE_RAJAXX) != IN_PROGRESS)
break;

GuidSet& army = m_sArmyWavesGuids[m_uiCurrentArmyWave - 1];
bool startNext = false;
{
MAPLOCK_WRITE(pCreature, MAP_LOCK_TYPE_DEFAULT);
GuidSet& army = m_sArmyWavesGuids[m_uiCurrentArmyWave - 1];

if (army.empty() || army.find(guid) == army.end())
break;
if (army.empty() || army.find(guid) == army.end())
break;

// Check if the dead creature belongs to the current wave
army.erase(guid);
// Check if the dead creature belongs to the current wave
army.erase(guid);
startNext = army.empty();
}

// If all the soldiers from the current wave are dead, then send the next one
if (army.empty())
if (startNext)
DoSendNextArmyWave();

break;
Expand Down
2 changes: 1 addition & 1 deletion sd2_revision_R2.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_R2_H__
#define __SD2_REVISION_R2_H__
#define SD2_REVISION_R2 "0568"
#define SD2_REVISION_R2 "0569"
#endif // __SD2_REVISION_R2_H__

0 comments on commit 38d9ee6

Please sign in to comment.