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.
This commit is contained in:
MrD4rk5oul 2024-12-27 16:51:17 -03:00 committed by GitHub
parent 52211de8e9
commit 3cd6ce9bb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,7 +31,7 @@
#include "teleporter.h" #include "teleporter.h"
CDetour *canPlayerTeleportDetour = NULL; CDetour *canPlayerBeTeleportedDetour = NULL;
IForward *g_teleportForward = NULL; IForward *g_teleportForward = NULL;
@ -84,11 +84,11 @@ DETOUR_DECL_MEMBER1(CanPlayerBeTeleported, bool, CTFPlayer *, pPlayer)
bool InitialiseTeleporterDetour() 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; return true;
} }
@ -99,9 +99,9 @@ bool InitialiseTeleporterDetour()
void RemoveTeleporterDetour() void RemoveTeleporterDetour()
{ {
if (canPlayerTeleportDetour != NULL) if (canPlayerBeTeleportedDetour != NULL)
{ {
canPlayerTeleportDetour->Destroy(); canPlayerBeTeleportedDetour->Destroy();
canPlayerTeleportDetour = NULL; canPlayerBeTeleportedDetour = NULL;
} }
} }