Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer ignore bots for movement function hooks #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions addons/sourcemod/scripting/movementapi/hooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Action UpdateMoveData(Address pThis, int client, Function func)
public MRESReturn DHooks_OnDuck_Pre(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
if (!IsPlayerAlive(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
{
return MRES_Ignored;
}
Expand All @@ -86,7 +86,7 @@ public MRESReturn DHooks_OnDuck_Pre(Address pThis)
public MRESReturn DHooks_OnDuck_Post(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
if (!IsPlayerAlive(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
{
return MRES_Ignored;
}
Expand Down Expand Up @@ -116,7 +116,7 @@ public MRESReturn DHooks_OnDuck_Post(Address pThis)
public MRESReturn DHooks_OnLadderMove_Pre(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
if (!IsPlayerAlive(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
{
return MRES_Ignored;
}
Expand All @@ -140,7 +140,7 @@ public MRESReturn DHooks_OnLadderMove_Post(Address pThis, DHookReturn hReturn)
// While the movetype changed here, the vertical velocity is not yet updated.
// gF_PostLadderMoveVelocity can be incorrect here.
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
if (!IsPlayerAlive(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
{
return MRES_Ignored;
}
Expand Down Expand Up @@ -207,7 +207,7 @@ public MRESReturn DHooks_OnLadderMove_Post(Address pThis, DHookReturn hReturn)
public MRESReturn DHooks_OnFullLadderMove_Pre(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand All @@ -226,7 +226,7 @@ public MRESReturn DHooks_OnFullLadderMove_Pre(Address pThis)
public MRESReturn DHooks_OnJump_Pre(Address pThis, DHookParam hParams)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand Down Expand Up @@ -265,7 +265,7 @@ public MRESReturn DHooks_OnJump_Pre(Address pThis, DHookParam hParams)
public MRESReturn DHooks_OnJump_Post(Address pThis, DHookParam hParams)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand Down Expand Up @@ -295,7 +295,7 @@ public MRESReturn DHooks_OnJump_Post(Address pThis, DHookParam hParams)
public MRESReturn DHooks_OnFullLadderMove_Post(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
if (!IsPlayerAlive(client) || Movement_GetMovetype(client) == MOVETYPE_NOCLIP)
{
return MRES_Ignored;
}
Expand All @@ -315,7 +315,7 @@ public MRESReturn DHooks_OnFullLadderMove_Post(Address pThis)
public MRESReturn DHooks_OnAirAccelerate_Pre(Address pThis, DHookParam hParams)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand All @@ -334,7 +334,7 @@ public MRESReturn DHooks_OnAirAccelerate_Pre(Address pThis, DHookParam hParams)
public MRESReturn DHooks_OnAirAccelerate_Post(Address pThis, DHookParam hParams)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand All @@ -357,7 +357,7 @@ public MRESReturn DHooks_OnAirAccelerate_Post(Address pThis, DHookParam hParams)
public MRESReturn DHooks_OnWalkMove_Pre(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand All @@ -376,7 +376,7 @@ public MRESReturn DHooks_OnWalkMove_Pre(Address pThis)
public MRESReturn DHooks_OnWalkMove_Post(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand All @@ -398,7 +398,7 @@ public MRESReturn DHooks_OnWalkMove_Post(Address pThis)
public MRESReturn DHooks_OnPlayerMove_Pre(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand All @@ -424,7 +424,7 @@ public MRESReturn DHooks_OnPlayerMove_Pre(Address pThis)
public MRESReturn DHooks_OnPlayerMove_Post(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand All @@ -443,7 +443,7 @@ public MRESReturn DHooks_OnPlayerMove_Post(Address pThis)
public MRESReturn DHooks_OnCategorizePosition_Pre(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand All @@ -464,7 +464,7 @@ public MRESReturn DHooks_OnCategorizePosition_Pre(Address pThis)
public MRESReturn DHooks_OnCategorizePosition_Post(Address pThis)
{
int client = GetClientFromGameMovementAddress(pThis);
if (!IsPlayerAlive(client) || IsFakeClient(client))
if (!IsPlayerAlive(client))
{
return MRES_Ignored;
}
Expand Down