diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 34c7a4eac..39f6c84fb 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -1098,8 +1098,7 @@ void CGameClient::OnNewSnapshot() mem_zero(&TempCore, sizeof(TempCore)); mem_zero(&TempTeams, sizeof(TempTeams)); TempCore.Init(&TempWorld, Collision(), &TempTeams); - TempCore.Read(pCharacter); - TempCore.m_ActiveWeapon = pCharacter->m_Weapon; + TempCore.ReadCharacter(pCharacter); while(pCharacter->m_Tick < Tick) { @@ -1274,7 +1273,7 @@ void CGameClient::OnNewSnapshot() { const void *pOld = Client()->SnapFindItem(IClient::SNAP_PREV, NETOBJTYPE_CHARACTER, Item.m_ID); m_Snap.m_aCharacters[Item.m_ID].m_Cur = *((const CNetObj_Character *)pData); - m_aClients[Item.m_ID].m_Predicted.Read((const CNetObj_Character *)pData); + m_aClients[Item.m_ID].m_Predicted.ReadCharacter((const CNetObj_Character *)pData); if(pOld) { m_Snap.m_aCharacters[Item.m_ID].m_Active = true; @@ -1709,13 +1708,11 @@ void CGameClient::OnPredict() { if(m_Snap.m_pLocalCharacter) { - m_PredictedChar.Read(m_Snap.m_pLocalCharacter); - m_PredictedChar.m_ActiveWeapon = m_Snap.m_pLocalCharacter->m_Weapon; + m_PredictedChar.ReadCharacter(m_Snap.m_pLocalCharacter); } if(m_Snap.m_pLocalPrevCharacter) { - m_PredictedPrevChar.Read(m_Snap.m_pLocalPrevCharacter); - m_PredictedPrevChar.m_ActiveWeapon = m_Snap.m_pLocalPrevCharacter->m_Weapon; + m_PredictedPrevChar.ReadCharacter(m_Snap.m_pLocalPrevCharacter); } return; } @@ -2520,7 +2517,7 @@ void CGameClient::DetectStrongHook() float PredictErr[2]; CCharacterCore ToCharCur; - ToCharCur.Read(&m_Snap.m_aCharacters[ToPlayer].m_Cur); + ToCharCur.ReadCharacterCore(&m_Snap.m_aCharacters[ToPlayer].m_Cur); CWorldCore World; World.m_Tuning[g_Config.m_ClDummy] = m_Tuning[g_Config.m_ClDummy]; @@ -2530,12 +2527,12 @@ void CGameClient::DetectStrongHook() CCharacterCore ToChar = pFromCharWorld->GetCore(); ToChar.Init(&World, Collision(), &m_Teams); World.m_apCharacters[ToPlayer] = &ToChar; - ToChar.Read(&m_Snap.m_aCharacters[ToPlayer].m_Prev); + ToChar.ReadCharacterCore(&m_Snap.m_aCharacters[ToPlayer].m_Prev); CCharacterCore FromChar = pFromCharWorld->GetCore(); FromChar.Init(&World, Collision(), &m_Teams); World.m_apCharacters[FromPlayer] = &FromChar; - FromChar.Read(&m_Snap.m_aCharacters[FromPlayer].m_Prev); + FromChar.ReadCharacterCore(&m_Snap.m_aCharacters[FromPlayer].m_Prev); for(int Tick = Client()->PrevGameTick(g_Config.m_ClDummy); Tick < Client()->GameTick(g_Config.m_ClDummy); Tick++) { diff --git a/src/game/client/prediction/entities/character.cpp b/src/game/client/prediction/entities/character.cpp index 1924fb284..d890d8b0c 100644 --- a/src/game/client/prediction/entities/character.cpp +++ b/src/game/client/prediction/entities/character.cpp @@ -1121,7 +1121,7 @@ void CCharacter::ResetPrediction() void CCharacter::Read(CNetObj_Character *pChar, CNetObj_DDNetCharacter *pExtended, bool IsLocal) { - m_Core.Read((CNetObj_CharacterCore *)pChar); + m_Core.ReadCharacterCore((const CNetObj_CharacterCore *)pChar); m_IsLocal = IsLocal; if(pExtended) diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index 1d98ca4b3..978628604 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -521,7 +521,7 @@ void CCharacterCore::Write(CNetObj_CharacterCore *pObjCore) pObjCore->m_Angle = m_Angle; } -void CCharacterCore::Read(const CNetObj_CharacterCore *pObjCore) +void CCharacterCore::ReadCharacterCore(const CNetObj_CharacterCore *pObjCore) { m_Pos.x = pObjCore->m_X; m_Pos.y = pObjCore->m_Y; @@ -539,10 +539,10 @@ void CCharacterCore::Read(const CNetObj_CharacterCore *pObjCore) m_Angle = pObjCore->m_Angle; } -void CCharacterCore::Read(const CNetObj_Character *pObjChar) +void CCharacterCore::ReadCharacter(const CNetObj_Character *pObjChar) { m_ActiveWeapon = pObjChar->m_Weapon; - Read((const CNetObj_CharacterCore *)pObjChar); + ReadCharacterCore((const CNetObj_CharacterCore *)pObjChar); } void CCharacterCore::ReadDDNet(const CNetObj_DDNetCharacter *pObjDDNet) { @@ -589,7 +589,7 @@ void CCharacterCore::Quantize() { CNetObj_CharacterCore Core; Write(&Core); - Read(&Core); + ReadCharacterCore(&Core); } // DDRace diff --git a/src/game/gamecore.h b/src/game/gamecore.h index dbcce8ee4..5e20e47be 100644 --- a/src/game/gamecore.h +++ b/src/game/gamecore.h @@ -248,8 +248,8 @@ public: void Tick(bool UseInput); void Move(); - void Read(const CNetObj_CharacterCore *pObjCore); - void Read(const CNetObj_Character *pObjCore); + void ReadCharacterCore(const CNetObj_CharacterCore *pObjCore); + void ReadCharacter(const CNetObj_Character *pObjCore); void Write(CNetObj_CharacterCore *pObjCore); void Quantize();