mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 10:28:34 +00:00
Fixes for OnPlayerTeleport hook for linux and linux64 systems (#2234)
* - 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.
(cherry picked from commit 52211de8e9)
This commit is contained in:
parent
e5921fed53
commit
8489e2e65a
@ -37,7 +37,18 @@ IForward *g_teleportForward = NULL;
|
|||||||
|
|
||||||
class CTFPlayer;
|
class CTFPlayer;
|
||||||
|
|
||||||
|
#if defined(__linux__) && defined(__i386__)
|
||||||
|
class CanPlayerBeTeleportedClass
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
__attribute__((regparm(2))) bool CanPlayerBeTeleported(CTFPlayer * pPlayer);
|
||||||
|
static __attribute__((regparm(2))) bool (CanPlayerBeTeleportedClass::* CanPlayerBeTeleported_Actual)(CTFPlayer *);
|
||||||
|
};
|
||||||
|
__attribute__((regparm(2))) bool (CanPlayerBeTeleportedClass::* CanPlayerBeTeleportedClass::CanPlayerBeTeleported_Actual)(CTFPlayer *) = NULL;
|
||||||
|
__attribute__((regparm(2))) bool CanPlayerBeTeleportedClass::CanPlayerBeTeleported(CTFPlayer* pPlayer)
|
||||||
|
#else
|
||||||
DETOUR_DECL_MEMBER1(CanPlayerBeTeleported, bool, CTFPlayer *, pPlayer)
|
DETOUR_DECL_MEMBER1(CanPlayerBeTeleported, bool, CTFPlayer *, pPlayer)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
bool origCanTeleport = DETOUR_MEMBER_CALL(CanPlayerBeTeleported)(pPlayer);
|
bool origCanTeleport = DETOUR_MEMBER_CALL(CanPlayerBeTeleported)(pPlayer);
|
||||||
|
|
||||||
|
|||||||
@ -126,6 +126,19 @@
|
|||||||
"linux" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer"
|
"linux" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer"
|
||||||
"linux64" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer"
|
"linux64" "@_Z21DuelMiniGame_IsInDuelP9CTFPlayer"
|
||||||
}
|
}
|
||||||
|
"CanPlayerBeTeleported"
|
||||||
|
{
|
||||||
|
/* String: "bidirectional_teleport" follow the xref, pick the function that doesn't involve another attribute, follow the graph view after 2 virtual function call, the first subroutine call is CanPlayerTeleport*/
|
||||||
|
"library" "server"
|
||||||
|
"windows" "\x55\x8B\xEC\x53\x56\x57\x8B\x7D\x08\x8B\xD9\x85\xFF\x0F\x84\x2A\x2A\x2A\x2A"
|
||||||
|
"windows64" "\x48\x89\x5C\x24\x08\x48\x89\x74\x24\x10\x57\x48\x83\xEC\x20\x48\x8B\xFA\x48\x8B\xF1\x48\x85\xD2\x0F\x84\x2A\x2A\x2A\x2A\x45\x33\xC0"
|
||||||
|
|
||||||
|
// Recent updates altered where the teleport check was called in Linux systems.
|
||||||
|
"linux" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer.part.0"
|
||||||
|
"linux64" "@_ZN17CObjectTeleporter21PlayerCanBeTeleportedEP9CTFPlayer.part.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Obsolete
|
||||||
"CanPlayerTeleport"
|
"CanPlayerTeleport"
|
||||||
{
|
{
|
||||||
/* String: "bidirectional_teleport" follow the xref, pick the function that doesn't involve another attribute, follow the graph view after 2 virtual function call, the first subroutine call is CanPlayerTeleport*/
|
/* String: "bidirectional_teleport" follow the xref, pick the function that doesn't involve another attribute, follow the graph view after 2 virtual function call, the first subroutine call is CanPlayerTeleport*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user