mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Added Alive Check
This commit is contained in:
parent
3c1c045722
commit
4486a7abed
|
@ -66,8 +66,8 @@ void CDoor::Snap(int SnappingClient)
|
|||
|
||||
CCharacter * Char = GameServer()->GetPlayerChar(SnappingClient);
|
||||
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||
if (Char && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (!Tick)) return;
|
||||
if(Char == 0) return;
|
||||
if(Char->m_Alive && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (!Tick)) return;
|
||||
|
||||
if(Char->Team() == TEAM_SUPER)
|
||||
{
|
||||
|
|
|
@ -124,7 +124,7 @@ void CDragger::Snap(int SnappingClient)
|
|||
|
||||
CCharacter * Char = GameServer()->GetPlayerChar(SnappingClient);
|
||||
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||
if (Char && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (!Tick)) return;
|
||||
if (Char && Char->m_Alive && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (!Tick)) return;
|
||||
if(Char && m_Target && Char->Team() != m_Target->Team()) return;
|
||||
|
||||
CNetObj_Laser *obj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
|
|
|
@ -95,7 +95,7 @@ void CGun::Snap(int SnappingClient)
|
|||
|
||||
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||
if (SnapChar && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (!Tick)) return;
|
||||
if (SnapChar && SnapChar->m_Alive && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (!Tick)) return;
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
pObj->m_X = (int)m_Pos.x;
|
||||
pObj->m_Y = (int)m_Pos.y;
|
||||
|
|
|
@ -113,8 +113,8 @@ void CLight::Snap(int SnappingClient)
|
|||
|
||||
CCharacter * Char = GameServer()->GetPlayerChar(SnappingClient);
|
||||
int Tick = (Server()->Tick()%Server()->TickSpeed())%6;
|
||||
if (Char && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (Tick)) return;
|
||||
if(Char == 0) return;
|
||||
if(!Char) return;
|
||||
if (Char->m_Alive && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()] && (Tick)) return;
|
||||
|
||||
if(Char->Team() == TEAM_SUPER)
|
||||
{
|
||||
|
|
|
@ -155,7 +155,7 @@ void CPickup::Snap(int SnappingClient)
|
|||
*/
|
||||
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||
if (SnapChar && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (!Tick)) return;
|
||||
if (SnapChar && SnapChar->m_Alive && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (!Tick)) return;
|
||||
CNetObj_Pickup *pP = static_cast<CNetObj_Pickup *>(Server()->SnapNewItem(NETOBJTYPE_PICKUP, m_Id, sizeof(CNetObj_Pickup)));
|
||||
pP->m_X = (int)m_Pos.x;
|
||||
pP->m_Y = (int)m_Pos.y;
|
||||
|
|
|
@ -81,7 +81,7 @@ void CPlasma::Snap(int SnappingClient)
|
|||
CCharacter* SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
int Tick = (Server()->Tick()%Server()->TickSpeed())%11;
|
||||
if(!SnapChar) return;
|
||||
if (!GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (!Tick)) return;
|
||||
if (SnapChar->m_Alive && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (!Tick)) return;
|
||||
if((SnapChar->Team() != m_ResponsibleTeam) && !SnapChar->GetPlayer()->m_IsUsingDDRaceClient) return;
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_Id, sizeof(CNetObj_Laser)));
|
||||
pObj->m_X = (int)m_Pos.x;
|
||||
|
|
|
@ -172,7 +172,7 @@ void CProjectile::Snap(int SnappingClient)
|
|||
return;
|
||||
CCharacter * SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
int Tick = (Server()->Tick()%Server()->TickSpeed())%6;
|
||||
if (SnapChar && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (Tick)) return;
|
||||
if (SnapChar && SnapChar->m_Alive && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()] && (Tick)) return;
|
||||
|
||||
if
|
||||
(
|
||||
|
|
Loading…
Reference in a new issue