PHP Code:
void SDK_OnTouch_Post(int entity, int other)
{
if (!IsClientInGame(entity))
return;
int ability = GetEntPropEnt(entity, Prop_Send, "m_customAbility");
if (ability == -1)
{
SDKUnhook(entity, SDKHook_TouchPost, SDK_OnTouch_Post);
return;
}
if (GetEntPropEnt(entity, Prop_Send, "m_hGroundEntity") != -1)
return;
if (GetEntPropFloat(ability, Prop_Send, "m_lungeAgainTimer", 1) != GetGameTime() + 0.5)
return;
if (other != 0)
return;
static float vPos[3], vEnd[3];
GetClientEyePosition(entity, vPos);
vEnd[0] = vPos[0];
vEnd[1] = vPos[1];
vEnd[2] = vPos[2] + 50.0;
static Handle tr;
tr = TR_TraceRayFilterEx(vPos, vEnd, MASK_VISIBLE, RayType_EndPoint, TraceFilter_NoSelf, entity);
if (TR_DidHit(tr))
{
if (TR_GetSurfaceFlags(tr) & (SURF_SKY2D|SURF_SKY))
{
SetEntPropFloat(ability, Prop_Send, "m_lungeAgainTimer", -1.0, 1);
}
}
delete tr;
}
bool TraceFilter_NoSelf(int entity, int contentsMask, any data)
{
return entity != data;
}
Seems like this. correct? and not sure whether it works.
Replace
SDK_OnTouch_Post in
https://github.com/Target5150/MoYu_S...d_backjump_fix
Edit:
Looks flawlessly working, though the block would only be applied on touching the sky, not on room ceiling.
I have no idea this should be improved further to block bouncing all ceilings, given generally room ceiling won't contribute to DPs.