mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Entities: Get rid of direct m_ID access
This commit is contained in:
parent
035a50dd0b
commit
b0db610a47
|
@ -66,7 +66,7 @@ void CDoor::Snap(int SnappingClient)
|
|||
return;
|
||||
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(
|
||||
NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
NETOBJTYPE_LASER, GetID(), sizeof(CNetObj_Laser)));
|
||||
|
||||
if(!pObj)
|
||||
return;
|
||||
|
|
|
@ -225,7 +225,7 @@ void CDragger::Snap(int SnappingClient)
|
|||
if(i == -1)
|
||||
{
|
||||
obj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(
|
||||
NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
NETOBJTYPE_LASER, GetID(), sizeof(CNetObj_Laser)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -123,7 +123,7 @@ void CGun::Snap(int SnappingClient)
|
|||
int Tick = (Server()->Tick() % Server()->TickSpeed()) % 11;
|
||||
if(Char && Char->IsAlive() && (m_Layer == LAYER_SWITCH && !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[Char->Team()]) && (!Tick))
|
||||
return;
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, GetID(), sizeof(CNetObj_Laser)));
|
||||
|
||||
if(!pObj)
|
||||
return;
|
||||
|
|
|
@ -275,7 +275,7 @@ void CLaser::Snap(int SnappingClient)
|
|||
|
||||
if(!CmaskIsSet(TeamMask, SnappingClient))
|
||||
return;
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(NETOBJTYPE_LASER, GetID(), sizeof(CNetObj_Laser)));
|
||||
if(!pObj)
|
||||
return;
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ void CLight::Snap(int SnappingClient)
|
|||
return;
|
||||
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(
|
||||
NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
NETOBJTYPE_LASER, GetID(), sizeof(CNetObj_Laser)));
|
||||
|
||||
if(!pObj)
|
||||
return;
|
||||
|
|
|
@ -166,7 +166,7 @@ void CPickup::Snap(int SnappingClient)
|
|||
return;
|
||||
|
||||
int Size = Server()->IsSixup(SnappingClient) ? 3 * 4 : sizeof(CNetObj_Pickup);
|
||||
CNetObj_Pickup *pP = static_cast<CNetObj_Pickup *>(Server()->SnapNewItem(NETOBJTYPE_PICKUP, m_ID, Size));
|
||||
CNetObj_Pickup *pP = static_cast<CNetObj_Pickup *>(Server()->SnapNewItem(NETOBJTYPE_PICKUP, GetID(), Size));
|
||||
if(!pP)
|
||||
return;
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ void CPlasma::Snap(int SnappingClient)
|
|||
return;
|
||||
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(
|
||||
NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
NETOBJTYPE_LASER, GetID(), sizeof(CNetObj_Laser)));
|
||||
|
||||
if(!pObj)
|
||||
return;
|
||||
|
|
|
@ -319,7 +319,7 @@ void CProjectile::Snap(int SnappingClient)
|
|||
if(m_Owner != -1 && !CmaskIsSet(TeamMask, SnappingClient))
|
||||
return;
|
||||
|
||||
CNetObj_Projectile *pProj = static_cast<CNetObj_Projectile *>(Server()->SnapNewItem(NETOBJTYPE_PROJECTILE, m_ID, sizeof(CNetObj_Projectile)));
|
||||
CNetObj_Projectile *pProj = static_cast<CNetObj_Projectile *>(Server()->SnapNewItem(NETOBJTYPE_PROJECTILE, GetID(), sizeof(CNetObj_Projectile)));
|
||||
if(pProj)
|
||||
{
|
||||
if(SnappingClient > -1 && GameServer()->m_apPlayers[SnappingClient] && GameServer()->m_apPlayers[SnappingClient]->GetClientVersion() >= VERSION_DDNET_ANTIPING_PROJECTILE)
|
||||
|
|
Loading…
Reference in a new issue