*Use map instead of vector to store capture points in opvp.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-19 18:17:30 -05:00
parent bd0dbcc9ad
commit 47b30023a5
8 changed files with 58 additions and 63 deletions
+7 -2
View File
@@ -113,7 +113,7 @@ public:
void AddGO(uint32 type, uint32 guid, uint32 entry = 0);
void AddCre(uint32 type, uint32 guid, uint32 entry = 0);
bool AddCapturePoint(uint32 entry, uint32 map, float x, float y, float z, float o = 0, float rotation0 = 0, float rotation1 = 0, float rotation2 = 0, float rotation3 = 0);
bool SetCapturePointData(uint32 entry, uint32 map, float x, float y, float z, float o = 0, float rotation0 = 0, float rotation1 = 0, float rotation2 = 0, float rotation3 = 0);
protected:
@@ -165,7 +165,7 @@ public:
// deletes all gos/creatures spawned by the pvp
void DeleteSpawns();
typedef std::vector<OPvPCapturePoint*> OPvPCapturePointMap;
typedef std::map<uint32/*lowguid*/, OPvPCapturePoint*> OPvPCapturePointMap;
virtual void FillInitialWorldStates(WorldPacket & data) {}
// called when a player triggers an areatrigger
@@ -221,6 +221,11 @@ protected:
virtual void HandlePlayerEnterZone(Player * plr, uint32 zone);
virtual void HandlePlayerLeaveZone(Player * plr, uint32 zone);
void AddCapturePoint(OPvPCapturePoint* cp)
{
m_capturePoints[cp->m_CapturePointGUID] = cp;
}
void RegisterZone(uint32 zoneid);
bool HasPlayer(Player *plr) const;
void TeamCastSpell(TeamId team, int32 spellId);