From 3cd6ce9bb0444f568660aed3183fdd4147d19e7d Mon Sep 17 00:00:00 2001 From: MrD4rk5oul <43491107+MrD4rk5oul@users.noreply.github.com> Date: Fri, 27 Dec 2024 16:51:17 -0300 Subject: [PATCH] Correction for sourcemod use the new teleportation check gamedata registry from now on. (#2235) * - Fixes for OnPlayerTeleport hook for linux and linux64 systems - Changed signature call of `CanPlayerTeleport` for linux/linux64 to current used name - Applied fix at detour class CanPlayerBeTeleported to use standard parameter proceedings for linux * Created a new registry for Teleportation Checking, marking the old one obsolete for older Sourcemod versions. * Correction for sourcemod use the correct registry from now on. --- extensions/tf2/teleporter.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/extensions/tf2/teleporter.cpp b/extensions/tf2/teleporter.cpp index 3d5c6a8a7..5905724db 100644 --- a/extensions/tf2/teleporter.cpp +++ b/extensions/tf2/teleporter.cpp @@ -31,7 +31,7 @@ #include "teleporter.h" -CDetour *canPlayerTeleportDetour = NULL; +CDetour *canPlayerBeTeleportedDetour = NULL; IForward *g_teleportForward = NULL; @@ -84,11 +84,11 @@ DETOUR_DECL_MEMBER1(CanPlayerBeTeleported, bool, CTFPlayer *, pPlayer) bool InitialiseTeleporterDetour() { - canPlayerTeleportDetour = DETOUR_CREATE_MEMBER(CanPlayerBeTeleported, "CanPlayerTeleport"); + canPlayerBeTeleportedDetour = DETOUR_CREATE_MEMBER(CanPlayerBeTeleported, "CanPlayerBeTeleported"); - if (canPlayerTeleportDetour != NULL) + if (canPlayerBeTeleportedDetour != NULL) { - canPlayerTeleportDetour->EnableDetour(); + canPlayerBeTeleportedDetour->EnableDetour(); return true; } @@ -99,9 +99,9 @@ bool InitialiseTeleporterDetour() void RemoveTeleporterDetour() { - if (canPlayerTeleportDetour != NULL) + if (canPlayerBeTeleportedDetour != NULL) { - canPlayerTeleportDetour->Destroy(); - canPlayerTeleportDetour = NULL; + canPlayerBeTeleportedDetour->Destroy(); + canPlayerBeTeleportedDetour = NULL; } }