mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
fixed a variable name
This commit is contained in:
parent
0c6f187e3b
commit
4dfcfc6913
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ public:
|
|||
} m_Latency;
|
||||
|
||||
private:
|
||||
CCharacter *Character;
|
||||
CCharacter *m_pCharacter;
|
||||
CGameContext *m_pGameServer;
|
||||
|
||||
CGameContext *GameServer() const { return m_pGameServer; }
|
||||
|
|
Loading…
Reference in a new issue