*Fix bugged opvp update timer.
--HG-- branch : trunk
This commit is contained in:
@@ -73,7 +73,7 @@ PlayerVisibilityNotifier::Notify()
|
||||
|
||||
if( i_data.HasData() )
|
||||
{
|
||||
uint32 entry = 0, map;
|
||||
/*uint32 entry = 0, map;
|
||||
float x,y;
|
||||
if(!i_visibleNow.empty())
|
||||
{
|
||||
@@ -81,7 +81,8 @@ PlayerVisibilityNotifier::Notify()
|
||||
map = (*i_visibleNow.begin())->GetMapId();
|
||||
x = (*i_visibleNow.begin())->GetPositionX();
|
||||
y = (*i_visibleNow.begin())->GetPositionY();
|
||||
}
|
||||
sLog.outError("notify %u %u %f %f", entry, map, x, y);
|
||||
}*/
|
||||
|
||||
// send create/outofrange packet to player (except player create updates that already sent using SendUpdateToPlayer)
|
||||
WorldPacket packet;
|
||||
|
||||
@@ -247,7 +247,7 @@ bool OPvPCapturePoint::Update(uint32 diff)
|
||||
}
|
||||
|
||||
// get the difference of numbers
|
||||
float fact_diff = (float)m_activePlayers[0].size() - (float)m_activePlayers[1].size();
|
||||
float fact_diff = ((float)m_activePlayers[0].size() - (float)m_activePlayers[1].size()) * diff / OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL;
|
||||
if(!fact_diff)
|
||||
return false;
|
||||
|
||||
@@ -283,16 +283,16 @@ bool OPvPCapturePoint::Update(uint32 diff)
|
||||
m_ShiftPhase += fact_diff;
|
||||
|
||||
// check limits, these are over the grey part
|
||||
if(m_ShiftPhase <= -m_ShiftMaxPhase * (float)(m_NeutralValue) / 100.0f)
|
||||
if(m_ShiftPhase < -m_ShiftMaxPhase * (float)(m_NeutralValue) / 100.0f)
|
||||
{
|
||||
if(m_ShiftPhase <= -m_ShiftMaxPhase)
|
||||
if(m_ShiftPhase < -m_ShiftMaxPhase)
|
||||
m_ShiftPhase = -m_ShiftMaxPhase;
|
||||
m_State = OBJECTIVESTATE_HORDE;
|
||||
return true;
|
||||
}
|
||||
else if(m_ShiftPhase >= m_ShiftMaxPhase * (float)(m_NeutralValue) / 100.0f)
|
||||
else if(m_ShiftPhase > m_ShiftMaxPhase * (float)(m_NeutralValue) / 100.0f)
|
||||
{
|
||||
if(m_ShiftPhase >= m_ShiftMaxPhase)
|
||||
if(m_ShiftPhase > m_ShiftMaxPhase)
|
||||
m_ShiftPhase = m_ShiftMaxPhase;
|
||||
m_State = OBJECTIVESTATE_ALLIANCE;
|
||||
return true;
|
||||
|
||||
@@ -31,7 +31,7 @@ INSTANTIATE_SINGLETON_1( OutdoorPvPMgr );
|
||||
|
||||
OutdoorPvPMgr::OutdoorPvPMgr()
|
||||
{
|
||||
m_UpdateTimer = OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL;
|
||||
m_UpdateTimer = 0;
|
||||
//sLog.outDebug("Instantiating OutdoorPvPMgr");
|
||||
}
|
||||
|
||||
@@ -187,14 +187,13 @@ OutdoorPvP * OutdoorPvPMgr::GetOutdoorPvPToZoneId(uint32 zoneid)
|
||||
|
||||
void OutdoorPvPMgr::Update(uint32 diff)
|
||||
{
|
||||
if(m_UpdateTimer < diff)
|
||||
m_UpdateTimer += diff;
|
||||
if(m_UpdateTimer > OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL)
|
||||
{
|
||||
for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
(*itr)->Update(diff);
|
||||
(*itr)->Update(m_UpdateTimer);
|
||||
m_UpdateTimer = 0;
|
||||
}
|
||||
m_UpdateTimer = OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL;
|
||||
} else m_UpdateTimer -= diff;
|
||||
}
|
||||
|
||||
bool OutdoorPvPMgr::HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go)
|
||||
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
// used in player event handling
|
||||
OutdoorPvPMap m_OutdoorPvPMap;
|
||||
// update interval
|
||||
float m_UpdateTimer;
|
||||
uint32 m_UpdateTimer;
|
||||
};
|
||||
|
||||
#define sOutdoorPvPMgr Trinity::Singleton<OutdoorPvPMgr>::Instance()
|
||||
|
||||
Reference in New Issue
Block a user