Skip to content

Commit

Permalink
Walls: Don't snap first point to infected
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Mar 2, 2024
1 parent e20075d commit 882b2de
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/game/server/infclass/entities/engineer-wall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ void CEngineerWall::Snap(int SnappingClient)
if(!DoSnapForClient(SnappingClient))
return;

if(!HasSecondPosition())
{
const CInfClassPlayer *pDestPlayer = GameController()->GetPlayer(SnappingClient);
if(pDestPlayer && !pDestPlayer->IsHuman())
{
return;
}
}

if(Server()->GetClientInfclassVersion(SnappingClient))
{
CNetObj_InfClassObject *pInfClassObject = SnapInfClassObject();
Expand Down
12 changes: 10 additions & 2 deletions src/game/server/infclass/entities/looper-wall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ void CLooperWall::Snap(int SnappingClient)
if(!DoSnapForClient(SnappingClient))
return;

const CInfClassPlayer *pDestPlayer = GameController()->GetPlayer(SnappingClient);
if(!HasSecondPosition())
{
if(pDestPlayer && !pDestPlayer->IsHuman())
{
return;
}
}

if(Server()->GetClientInfclassVersion(SnappingClient))
{
CNetObj_InfClassObject *pInfClassObject = SnapInfClassObject();
Expand Down Expand Up @@ -161,8 +170,7 @@ void CLooperWall::Snap(int SnappingClient)
return;
}

const CInfClassPlayer *pPlayer = GameController()->GetPlayer(SnappingClient);
const bool AntiPing = pPlayer && pPlayer->GetAntiPingEnabled();
const bool AntiPing = pDestPlayer && pDestPlayer->GetAntiPingEnabled();
vec2 dirVec = vec2(m_Pos.x-m_Pos2.x, m_Pos.y-m_Pos2.y);
vec2 dirVecN = normalize(dirVec);
vec2 dirVecT = vec2(dirVecN.y * g_Thickness * 0.5f, -dirVecN.x * g_Thickness * 0.5f);
Expand Down

0 comments on commit 882b2de

Please sign in to comment.