Skip to content

Commit 882b2de

Browse files
committed
Walls: Don't snap first point to infected
1 parent e20075d commit 882b2de

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/game/server/infclass/entities/engineer-wall.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ void CEngineerWall::Snap(int SnappingClient)
102102
if(!DoSnapForClient(SnappingClient))
103103
return;
104104

105+
if(!HasSecondPosition())
106+
{
107+
const CInfClassPlayer *pDestPlayer = GameController()->GetPlayer(SnappingClient);
108+
if(pDestPlayer && !pDestPlayer->IsHuman())
109+
{
110+
return;
111+
}
112+
}
113+
105114
if(Server()->GetClientInfclassVersion(SnappingClient))
106115
{
107116
CNetObj_InfClassObject *pInfClassObject = SnapInfClassObject();

src/game/server/infclass/entities/looper-wall.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,15 @@ void CLooperWall::Snap(int SnappingClient)
126126
if(!DoSnapForClient(SnappingClient))
127127
return;
128128

129+
const CInfClassPlayer *pDestPlayer = GameController()->GetPlayer(SnappingClient);
130+
if(!HasSecondPosition())
131+
{
132+
if(pDestPlayer && !pDestPlayer->IsHuman())
133+
{
134+
return;
135+
}
136+
}
137+
129138
if(Server()->GetClientInfclassVersion(SnappingClient))
130139
{
131140
CNetObj_InfClassObject *pInfClassObject = SnapInfClassObject();
@@ -161,8 +170,7 @@ void CLooperWall::Snap(int SnappingClient)
161170
return;
162171
}
163172

164-
const CInfClassPlayer *pPlayer = GameController()->GetPlayer(SnappingClient);
165-
const bool AntiPing = pPlayer && pPlayer->GetAntiPingEnabled();
173+
const bool AntiPing = pDestPlayer && pDestPlayer->GetAntiPingEnabled();
166174
vec2 dirVec = vec2(m_Pos.x-m_Pos2.x, m_Pos.y-m_Pos2.y);
167175
vec2 dirVecN = normalize(dirVec);
168176
vec2 dirVecT = vec2(dirVecN.y * g_Thickness * 0.5f, -dirVecN.x * g_Thickness * 0.5f);

0 commit comments

Comments
 (0)