From 4dfcfc6913251bd1b1112749596f35fbc514b079 Mon Sep 17 00:00:00 2001 From: Choupom Date: Tue, 19 Apr 2011 10:42:48 +0200 Subject: [PATCH] fixed a variable name --- src/game/server/player.cpp | 48 +++++++++++++++++++------------------- src/game/server/player.h | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index aeafe3a4e..23cb7d764 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -15,8 +15,8 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team) m_RespawnTick = Server()->Tick(); m_DieTick = Server()->Tick(); m_ScoreStartTick = Server()->Tick(); - Character = 0; - this->m_ClientID = ClientID; + m_pCharacter = 0; + m_ClientID = ClientID; m_Team = GameServer()->m_pController->ClampTeam(Team); m_SpectatorID = SPEC_FREEVIEW; m_LastActionTick = Server()->Tick(); @@ -24,8 +24,8 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team) CPlayer::~CPlayer() { - delete Character; - Character = 0; + delete m_pCharacter; + m_pCharacter = 0; } void CPlayer::Tick() @@ -59,19 +59,19 @@ void CPlayer::Tick() } } - if(!Character && m_DieTick+Server()->TickSpeed()*3 <= Server()->Tick()) + if(!m_pCharacter && m_DieTick+Server()->TickSpeed()*3 <= Server()->Tick()) m_Spawning = true; - if(Character) + if(m_pCharacter) { - if(Character->IsAlive()) + if(m_pCharacter->IsAlive()) { - m_ViewPos = Character->m_Pos; + m_ViewPos = m_pCharacter->m_Pos; } else { - delete Character; - Character = 0; + delete m_pCharacter; + m_pCharacter = 0; } } else if(m_Spawning && m_RespawnTick <= Server()->Tick()) @@ -160,21 +160,21 @@ void CPlayer::OnDisconnect(const char *pReason) void CPlayer::OnPredictedInput(CNetObj_PlayerInput *NewInput) { - if(Character) - Character->OnPredictedInput(NewInput); + if(m_pCharacter) + m_pCharacter->OnPredictedInput(NewInput); } void CPlayer::OnDirectInput(CNetObj_PlayerInput *NewInput) { m_PlayerFlags = NewInput->m_PlayerFlags; - if(Character) - Character->OnDirectInput(NewInput); + if(m_pCharacter) + m_pCharacter->OnDirectInput(NewInput); - if(!Character && m_Team != TEAM_SPECTATORS && (NewInput->m_Fire&1)) + if(!m_pCharacter && m_Team != TEAM_SPECTATORS && (NewInput->m_Fire&1)) m_Spawning = true; - if(!Character && m_Team == TEAM_SPECTATORS && m_SpectatorID == SPEC_FREEVIEW) + if(!m_pCharacter && m_Team == TEAM_SPECTATORS && m_SpectatorID == SPEC_FREEVIEW) m_ViewPos = vec2(NewInput->m_TargetX, NewInput->m_TargetY); // check for activity @@ -190,18 +190,18 @@ void CPlayer::OnDirectInput(CNetObj_PlayerInput *NewInput) CCharacter *CPlayer::GetCharacter() { - if(Character && Character->IsAlive()) - return Character; + if(m_pCharacter && m_pCharacter->IsAlive()) + return m_pCharacter; return 0; } void CPlayer::KillCharacter(int Weapon) { - if(Character) + if(m_pCharacter) { - Character->Die(m_ClientID, Weapon); - delete Character; - Character = 0; + m_pCharacter->Die(m_ClientID, Weapon); + delete m_pCharacter; + m_pCharacter = 0; } } @@ -252,7 +252,7 @@ void CPlayer::TryRespawn() return; m_Spawning = false; - Character = new(m_ClientID) CCharacter(&GameServer()->m_World); - Character->Spawn(this, SpawnPos); + m_pCharacter = new(m_ClientID) CCharacter(&GameServer()->m_World); + m_pCharacter->Spawn(this, SpawnPos); GameServer()->CreatePlayerSpawn(SpawnPos); } diff --git a/src/game/server/player.h b/src/game/server/player.h index 9d5e462c8..de06bd3a1 100644 --- a/src/game/server/player.h +++ b/src/game/server/player.h @@ -96,7 +96,7 @@ public: } m_Latency; private: - CCharacter *Character; + CCharacter *m_pCharacter; CGameContext *m_pGameServer; CGameContext *GameServer() const { return m_pGameServer; }