Skip to content

Commit 3b013dd

Browse files
Fix incorrect onPlayerTeleport trigger on destroyed contact element (#4298)
1 parent 7c27c20 commit 3b013dd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Server/mods/deathmatch/logic/packets/CPlayerPuresyncPacket.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ bool CPlayerPuresyncPacket::Read(NetBitStreamInterface& BitStream)
101101
}
102102
}
103103

104+
// If the client reported contact but the element doesn't exist anymore,
105+
// the coordinates become invalid as they are relative to that element.
106+
if (positionRead && pContactElement == nullptr && flags.data.bHasContact)
107+
{
108+
position.data.vecPosition = pSourcePlayer->GetPosition();
109+
}
110+
104111
CElement* pPreviousContactElement = pSourcePlayer->GetContactElement();
105112
pSourcePlayer->SetContactElement(pContactElement);
106113

0 commit comments

Comments
 (0)