*Set pvp flags for units controlled by player.

*Reset pvp flags when unit is uncharmed.
*Remove walk flag when unit is charmed.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-22 03:12:35 -05:00
parent 5888134e4d
commit 3641be039b
3 changed files with 82 additions and 56 deletions
+10 -1
View File
@@ -213,9 +213,11 @@ struct PlayerInfo
struct PvPInfo
{
PvPInfo() : inHostileArea(false), endTimer(0) {}
PvPInfo() : inHostileArea(false), inNoPvPArea(false), inFFAPvPArea(false), endTimer(0) {}
bool inHostileArea;
bool inNoPvPArea;
bool inFFAPvPArea;
time_t endTimer;
};
@@ -1423,6 +1425,13 @@ class TRINITY_DLL_SPEC Player : public Unit
void SendInitialActionButtons() const;
PvPInfo pvpInfo;
void UpdatePvPState(bool onlyFFA = false);
void SetPvP(bool state)
{
Unit::SetPvP(state);
for(ControlList::iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
(*itr)->SetPvP(state);
}
void UpdatePvP(bool state, bool ovrride=false);
void UpdateZone(uint32 newZone,uint32 newArea);
void UpdateArea(uint32 newArea);