mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Small fix and cleanup of prediction of teams/solo
This commit is contained in:
parent
9c9264db8b
commit
8a18cabbb1
|
@ -350,7 +350,6 @@ void CGameClient::OnInit()
|
|||
|
||||
m_GameWorld.m_GameTickSpeed = SERVER_TICK_SPEED;
|
||||
m_GameWorld.m_pCollision = Collision();
|
||||
m_GameWorld.m_pTeams = &m_TeamsPredicted;
|
||||
|
||||
m_pMapimages->SetTextureScale(g_Config.m_ClTextEntitiesSize);
|
||||
}
|
||||
|
@ -1989,8 +1988,6 @@ void CGameClient::UpdatePrediction()
|
|||
return;
|
||||
}
|
||||
|
||||
m_TeamsPredicted = m_Teams;
|
||||
|
||||
m_GameWorld.m_WorldConfig.m_IsVanilla = m_GameInfo.m_PredictVanilla;
|
||||
m_GameWorld.m_WorldConfig.m_IsDDRace = m_GameInfo.m_PredictDDRace;
|
||||
m_GameWorld.m_WorldConfig.m_IsFNG = m_GameInfo.m_PredictFNG;
|
||||
|
@ -2069,6 +2066,8 @@ void CGameClient::UpdatePrediction()
|
|||
}
|
||||
|
||||
// update the local gameworld with the new snapshot
|
||||
m_GameWorld.m_Teams = m_Teams;
|
||||
|
||||
m_GameWorld.NetObjBegin();
|
||||
int Num = Client()->SnapNumItems(IClient::SNAP_CURRENT);
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
|
|
|
@ -459,7 +459,6 @@ private:
|
|||
|
||||
CCharOrder m_CharOrder;
|
||||
class CCharacter m_aLastWorldCharacters[MAX_CLIENTS];
|
||||
class CTeamsCore m_TeamsPredicted;
|
||||
};
|
||||
|
||||
ColorRGBA CalculateNameColor(ColorHSLA TextColorHSL);
|
||||
|
|
|
@ -21,7 +21,6 @@ CGameWorld::CGameWorld()
|
|||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
m_apCharacters[i] = 0;
|
||||
m_pCollision = 0;
|
||||
m_pTeams = 0;
|
||||
m_GameTick = 0;
|
||||
m_pParent = 0;
|
||||
m_pChild = 0;
|
||||
|
@ -517,7 +516,7 @@ void CGameWorld::CopyWorld(CGameWorld *pFrom)
|
|||
m_WorldConfig = pFrom->m_WorldConfig;
|
||||
for(int i = 0; i < 2; i++)
|
||||
m_Core.m_Tuning[i] = pFrom->m_Core.m_Tuning[i];
|
||||
m_pTeams = pFrom->m_pTeams;
|
||||
m_Teams = pFrom->m_Teams;
|
||||
// delete the previous entities
|
||||
for(int i = 0; i < NUM_ENTTYPES; i++)
|
||||
while(m_apFirstEntityTypes[i])
|
||||
|
|
|
@ -25,6 +25,7 @@ public:
|
|||
};
|
||||
|
||||
CWorldCore m_Core;
|
||||
CTeamsCore m_Teams;
|
||||
|
||||
CGameWorld();
|
||||
~CGameWorld();
|
||||
|
@ -47,13 +48,12 @@ public:
|
|||
int m_GameTick;
|
||||
int m_GameTickSpeed;
|
||||
CCollision *m_pCollision;
|
||||
CTeamsCore *m_pTeams;
|
||||
|
||||
// getter for server variables
|
||||
int GameTick() { return m_GameTick; }
|
||||
int GameTickSpeed() { return m_GameTickSpeed; }
|
||||
class CCollision *Collision() { return m_pCollision; }
|
||||
CTeamsCore *Teams() { return m_pTeams; }
|
||||
CTeamsCore *Teams() { return &m_Teams; }
|
||||
CTuningParams *Tuning();
|
||||
CEntity *GetEntity(int ID, int EntityType);
|
||||
class CCharacter *GetCharacterByID(int ID) { return (ID >= 0 && ID < MAX_CLIENTS) ? m_apCharacters[ID] : 0; }
|
||||
|
|
Loading…
Reference in a new issue