*Wintergrasp: fix the bug that player is send into hall when dead near hall.

*Only revive player in the graveyard which is occupied.
*Do not allow to use titan relic if hall gate is not destroyed.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-31 13:43:54 -05:00
parent 6a50516174
commit a4f6659f7a
6 changed files with 76 additions and 19 deletions
+15 -3
View File
@@ -116,13 +116,14 @@ struct BuildingState
explicit BuildingState(uint32 _worldState, TeamId _team, bool asDefault)
: worldState(_worldState), health(0)
, defaultTeam(asDefault ? _team : OTHER_TEAM(_team)), team(_team), damageState(DAMAGE_INTACT)
, building(NULL), type(BUILDING_WALL)
, building(NULL), type(BUILDING_WALL), graveTeam(NULL)
{}
uint32 worldState;
uint32 health;
TeamId team, defaultTeam;
TeamId defaultTeam;
DamageState damageState;
GameObject *building;
uint32 *graveTeam;
BuildingType type;
void SendUpdate(Player *player) const
@@ -134,6 +135,16 @@ struct BuildingState
{
data << worldState << AreaPOIIconId[team][damageState];
}
TeamId GetTeam() const { return team; }
void SetTeam(TeamId t)
{
team = t;
if(graveTeam)
*graveTeam = TeamId2Team[t];
}
private:
TeamId team;
};
typedef std::map<uint32, uint32> TeamPairMap;
@@ -147,7 +158,7 @@ class OPvPWintergrasp : public OutdoorPvP
typedef std::set<Creature*> CreatureSet;
typedef std::set<GameObject*> GameObjectSet;
public:
explicit OPvPWintergrasp() : m_tenacityStack(0) {}
explicit OPvPWintergrasp() : m_tenacityStack(0), m_gate(NULL) {}
bool SetupOutdoorPvP();
uint32 GetCreatureEntry(uint32 guidlow, const CreatureData *data);
@@ -175,6 +186,7 @@ class OPvPWintergrasp : public OutdoorPvP
int32 m_tenacityStack;
BuildingStateMap m_buildingStates;
BuildingState *m_gate;
CreatureSet m_creatures;
CreatureSet m_vehicles[2];