mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
tweaked respawndelay a bit
This commit is contained in:
parent
cb1c63c652
commit
42a68636b5
|
@ -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];
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -86,7 +86,6 @@ public:
|
|||
int m_ColorFeet;
|
||||
} m_TeeInfos;
|
||||
|
||||
int m_RespawnTick;
|
||||
int m_DieTick;
|
||||
int m_Score;
|
||||
int m_JoinTick;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue