mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Rename GetTunes
to GetTuning
and return const pointer
No need to copy all tuning parameters. Consistent naming with prediction code where `GetTuning` is also used.
This commit is contained in:
parent
b98d519744
commit
30d3d4f94c
|
@ -30,21 +30,21 @@ void CItems::RenderProjectile(const CProjectileData *pCurrent, int ItemID)
|
||||||
// get positions
|
// get positions
|
||||||
float Curvature = 0;
|
float Curvature = 0;
|
||||||
float Speed = 0;
|
float Speed = 0;
|
||||||
CTuningParams Tuning = GameClient()->GetTunes(pCurrent->m_TuneZone);
|
const CTuningParams *pTuning = GameClient()->GetTuning(pCurrent->m_TuneZone);
|
||||||
if(CurWeapon == WEAPON_GRENADE)
|
if(CurWeapon == WEAPON_GRENADE)
|
||||||
{
|
{
|
||||||
Curvature = Tuning.m_GrenadeCurvature;
|
Curvature = pTuning->m_GrenadeCurvature;
|
||||||
Speed = Tuning.m_GrenadeSpeed;
|
Speed = pTuning->m_GrenadeSpeed;
|
||||||
}
|
}
|
||||||
else if(CurWeapon == WEAPON_SHOTGUN)
|
else if(CurWeapon == WEAPON_SHOTGUN)
|
||||||
{
|
{
|
||||||
Curvature = Tuning.m_ShotgunCurvature;
|
Curvature = pTuning->m_ShotgunCurvature;
|
||||||
Speed = Tuning.m_ShotgunSpeed;
|
Speed = pTuning->m_ShotgunSpeed;
|
||||||
}
|
}
|
||||||
else if(CurWeapon == WEAPON_GUN)
|
else if(CurWeapon == WEAPON_GUN)
|
||||||
{
|
{
|
||||||
Curvature = Tuning.m_GunCurvature;
|
Curvature = pTuning->m_GunCurvature;
|
||||||
Speed = Tuning.m_GunSpeed;
|
Speed = pTuning->m_GunSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LocalPlayerInGame = false;
|
bool LocalPlayerInGame = false;
|
||||||
|
@ -310,7 +310,7 @@ void CItems::RenderLaser(const CLaserData *pCurrent, bool IsPredicted)
|
||||||
else
|
else
|
||||||
Ticks = (float)(Client()->GameTick(g_Config.m_ClDummy) - pCurrent->m_StartTick) + Client()->IntraGameTick(g_Config.m_ClDummy);
|
Ticks = (float)(Client()->GameTick(g_Config.m_ClDummy) - pCurrent->m_StartTick) + Client()->IntraGameTick(g_Config.m_ClDummy);
|
||||||
float Ms = (Ticks / 50.0f) * 1000.0f;
|
float Ms = (Ticks / 50.0f) * 1000.0f;
|
||||||
float a = Ms / m_pClient->GetTunes(TuneZone).m_LaserBounceDelay;
|
float a = Ms / m_pClient->GetTuning(TuneZone)->m_LaserBounceDelay;
|
||||||
a = clamp(a, 0.0f, 1.0f);
|
a = clamp(a, 0.0f, 1.0f);
|
||||||
float Ia = 1 - a;
|
float Ia = 1 - a;
|
||||||
|
|
||||||
|
@ -600,22 +600,22 @@ void CItems::ReconstructSmokeTrail(const CProjectileData *pCurrent, int DestroyT
|
||||||
// get positions
|
// get positions
|
||||||
float Curvature = 0;
|
float Curvature = 0;
|
||||||
float Speed = 0;
|
float Speed = 0;
|
||||||
CTuningParams Tuning = GameClient()->GetTunes(pCurrent->m_TuneZone);
|
const CTuningParams *pTuning = GameClient()->GetTuning(pCurrent->m_TuneZone);
|
||||||
|
|
||||||
if(pCurrent->m_Type == WEAPON_GRENADE)
|
if(pCurrent->m_Type == WEAPON_GRENADE)
|
||||||
{
|
{
|
||||||
Curvature = Tuning.m_GrenadeCurvature;
|
Curvature = pTuning->m_GrenadeCurvature;
|
||||||
Speed = Tuning.m_GrenadeSpeed;
|
Speed = pTuning->m_GrenadeSpeed;
|
||||||
}
|
}
|
||||||
else if(pCurrent->m_Type == WEAPON_SHOTGUN)
|
else if(pCurrent->m_Type == WEAPON_SHOTGUN)
|
||||||
{
|
{
|
||||||
Curvature = Tuning.m_ShotgunCurvature;
|
Curvature = pTuning->m_ShotgunCurvature;
|
||||||
Speed = Tuning.m_ShotgunSpeed;
|
Speed = pTuning->m_ShotgunSpeed;
|
||||||
}
|
}
|
||||||
else if(pCurrent->m_Type == WEAPON_GUN)
|
else if(pCurrent->m_Type == WEAPON_GUN)
|
||||||
{
|
{
|
||||||
Curvature = Tuning.m_GunCurvature;
|
Curvature = pTuning->m_GunCurvature;
|
||||||
Speed = Tuning.m_GunSpeed;
|
Speed = pTuning->m_GunSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
float Pt = ((float)(Client()->PredGameTick(g_Config.m_ClDummy) - pCurrent->m_StartTick) + Client()->PredIntraGameTick(g_Config.m_ClDummy)) / (float)SERVER_TICK_SPEED;
|
float Pt = ((float)(Client()->PredGameTick(g_Config.m_ClDummy) - pCurrent->m_StartTick) + Client()->PredIntraGameTick(g_Config.m_ClDummy)) / (float)SERVER_TICK_SPEED;
|
||||||
|
|
|
@ -529,7 +529,7 @@ public:
|
||||||
bool AntiPingGunfire() { return AntiPingGrenade() && AntiPingWeapons() && g_Config.m_ClAntiPingGunfire; }
|
bool AntiPingGunfire() { return AntiPingGrenade() && AntiPingWeapons() && g_Config.m_ClAntiPingGunfire; }
|
||||||
bool Predict() { return g_Config.m_ClPredict && !(m_Snap.m_pGameInfoObj && m_Snap.m_pGameInfoObj->m_GameStateFlags & GAMESTATEFLAG_GAMEOVER) && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK && m_Snap.m_pLocalCharacter; }
|
bool Predict() { return g_Config.m_ClPredict && !(m_Snap.m_pGameInfoObj && m_Snap.m_pGameInfoObj->m_GameStateFlags & GAMESTATEFLAG_GAMEOVER) && !m_Snap.m_SpecInfo.m_Active && Client()->State() != IClient::STATE_DEMOPLAYBACK && m_Snap.m_pLocalCharacter; }
|
||||||
bool PredictDummy() { return g_Config.m_ClPredictDummy && Client()->DummyConnected() && m_Snap.m_LocalClientID >= 0 && m_PredictedDummyID >= 0 && !m_aClients[m_PredictedDummyID].m_Paused; }
|
bool PredictDummy() { return g_Config.m_ClPredictDummy && Client()->DummyConnected() && m_Snap.m_LocalClientID >= 0 && m_PredictedDummyID >= 0 && !m_aClients[m_PredictedDummyID].m_Paused; }
|
||||||
CTuningParams GetTunes(int i) { return m_aTuningList[i]; }
|
const CTuningParams *GetTuning(int i) { return &m_aTuningList[i]; }
|
||||||
|
|
||||||
CGameWorld m_GameWorld;
|
CGameWorld m_GameWorld;
|
||||||
CGameWorld m_PredictedWorld;
|
CGameWorld m_PredictedWorld;
|
||||||
|
|
Loading…
Reference in a new issue