tweaked respawndelay a bit

This commit is contained in:
H-M-H 2016-02-02 21:14:46 +01:00
parent cb1c63c652
commit 42a68636b5
5 changed files with 4 additions and 11 deletions

View file

@ -885,8 +885,6 @@ void CCharacter::Die(int Killer, int Weapon)
if(Server()->IsRecording(m_pPlayer->GetCID()))
Server()->StopRecord(m_pPlayer->GetCID());
// we got to wait 0.5 secs before respawning
m_pPlayer->m_RespawnTick = Server()->Tick()+Server()->TickSpeed()/2;
int ModeSpecial = GameServer()->m_pController->OnCharacterDeath(this, GameServer()->m_apPlayers[Killer], Weapon);
char aBuf[256];

View file

@ -1664,6 +1664,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
pPlayer->m_LastKill = Server()->Tick();
pPlayer->KillCharacter(WEAPON_SELF);
pPlayer->Respawn();
}
}
if (MsgID == NETMSGTYPE_CL_STARTINFO)

View file

@ -38,7 +38,6 @@ CPlayer::~CPlayer()
void CPlayer::Reset()
{
m_RespawnTick = Server()->Tick();
m_DieTick = Server()->Tick();
m_JoinTick = Server()->Tick();
if (m_pCharacter)
@ -231,12 +230,11 @@ void CPlayer::Tick()
m_pCharacter = 0;
}
}
else if(m_Spawning && m_RespawnTick <= Server()->Tick())
else if(m_Spawning)
TryRespawn();
}
else
{
++m_RespawnTick;
++m_DieTick;
++m_JoinTick;
++m_LastActionTick;
@ -461,9 +459,6 @@ void CPlayer::KillCharacter(int Weapon)
{
if(m_pCharacter)
{
if (m_RespawnTick > Server()->Tick())
return;
m_pCharacter->Die(m_ClientID, Weapon);
delete m_pCharacter;
@ -512,8 +507,6 @@ void CPlayer::SetTeam(int Team, bool DoChatMsg)
m_LastSetTeam = Server()->Tick();
m_LastActionTick = Server()->Tick();
m_SpectatorID = SPEC_FREEVIEW;
// we got to wait 0.5 secs before respawning
m_RespawnTick = Server()->Tick()+Server()->TickSpeed()/2;
str_format(aBuf, sizeof(aBuf), "team_join player='%d:%s' m_Team=%d", m_ClientID, Server()->ClientName(m_ClientID), m_Team);
GameServer()->Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "game", aBuf);

View file

@ -86,7 +86,6 @@ public:
int m_ColorFeet;
} m_TeeInfos;
int m_RespawnTick;
int m_DieTick;
int m_Score;
int m_JoinTick;

View file

@ -635,6 +635,8 @@ void CGameTeams::OnCharacterDeath(int ClientID, int Weapon)
if(m_Core.Team(i) == Team && i != ClientID && GameServer()->m_apPlayers[i])
{
GameServer()->m_apPlayers[i]->KillCharacter(WEAPON_SELF);
if (Weapon == WEAPON_SELF)
GameServer()->m_apPlayers[i]->Respawn();
GameServer()->SendChatTarget(i, aBuf);
}
}