diff options
author | megamage <none@none> | 2009-08-19 18:17:30 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-19 18:17:30 -0500 |
commit | 47b30023a573dcd3daf67508da6c31ae2033e28f (patch) | |
tree | 5b152518842aa5517ebadc6830bd354da38f6606 /src/game/Wintergrasp.cpp | |
parent | bd0dbcc9ad239e608ebc881558f64877b60d14d8 (diff) |
*Use map instead of vector to store capture points in opvp.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Wintergrasp.cpp')
-rw-r--r-- | src/game/Wintergrasp.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp index a780e7a91d4..518cc917833 100644 --- a/src/game/Wintergrasp.cpp +++ b/src/game/Wintergrasp.cpp @@ -253,7 +253,7 @@ bool OPvPWintergrasp::SetupOutdoorPvP() } SiegeWorkshop *workshop = new SiegeWorkshop(this, m_buildingStates[guid]); - if(!workshop->AddCapturePoint(capturePointEntry, goData->mapid, goData->posX, goData->posY, goData->posZ)) + if(!workshop->SetCapturePointData(capturePointEntry, goData->mapid, goData->posX, goData->posY, goData->posZ)) { delete workshop; sLog.outError("Cannot add capture point!"); @@ -269,7 +269,7 @@ bool OPvPWintergrasp::SetupOutdoorPvP() workshop->m_engGuid = engGuid; //workshop->AddCre(0, engGuid, creData->id); //sLog.outDebug("Demolisher Engineerer lowguid %u is linked to workshop lowguid %u.", engGuid, guid); - m_capturePoints.push_back(workshop); + AddCapturePoint(workshop); workshop->SetStateByBuildingState(); } }while(result->NextRow()); @@ -375,7 +375,7 @@ void OPvPWintergrasp::OnCreatureCreate(Creature *creature, bool add) else if(entry == CRE_ENG_A || entry == CRE_ENG_H) // demolisher engineers { for(OutdoorPvP::OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr) - if(SiegeWorkshop *workshop = dynamic_cast<SiegeWorkshop*>(*itr)) + if(SiegeWorkshop *workshop = dynamic_cast<SiegeWorkshop*>(itr->second)) if(workshop->m_engGuid == creature->GetDBTableGUIDLow()) { workshop->m_engineer = add ? creature : NULL; @@ -427,7 +427,7 @@ void OPvPWintergrasp::UpdateAllWorldObject() // update capture points for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr) - if(SiegeWorkshop *workshop = dynamic_cast<SiegeWorkshop*>(*itr)) + if(SiegeWorkshop *workshop = dynamic_cast<SiegeWorkshop*>(itr->second)) workshop->SetStateByBuildingState(); SendInitWorldStatesTo(); |