*Fix bugged opvp update timer.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-06 14:29:06 -05:00
parent eb9d89e5ce
commit 16d44db8f7
4 changed files with 17 additions and 17 deletions
+3 -2
View File
@@ -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;
+7 -7
View File
@@ -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;
@@ -259,8 +259,8 @@ bool OPvPCapturePoint::Update(uint32 diff)
if(m_State == OBJECTIVESTATE_HORDE && m_ShiftPhase <= -m_ShiftMaxPhase)
return false;
if(fact_diff < - m_ShiftMaxCaptureSpeed)
fact_diff = - m_ShiftMaxCaptureSpeed;
if(fact_diff < -m_ShiftMaxCaptureSpeed)
fact_diff = -m_ShiftMaxCaptureSpeed;
Challenger = HORDE;
}
@@ -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;
+5 -6
View File
@@ -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)
+1 -1
View File
@@ -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()