View Single Post
Forgetest
Member
Join Date: Aug 2020
Old 07-06-2022 , 17:12   Re: [L4D2] Hunter flying skybox patch
Reply With Quote #7

PHP Code:
void SDK_OnTouch_Post(int entityint other)
{
    if (!
IsClientInGame(entity))
        return;
    
    
int ability GetEntPropEnt(entityProp_Send"m_customAbility");
    if (
ability == -1)
    {
        
SDKUnhook(entitySDKHook_TouchPostSDK_OnTouch_Post);
        return;
    }
    
    if (
GetEntPropEnt(entityProp_Send"m_hGroundEntity") != -1)
        return;

    if (
GetEntPropFloat(abilityProp_Send"m_lungeAgainTimer"1) != GetGameTime() + 0.5)
        return;
    
    if (
other != 0)
        return;
    
    static 
float vPos[3], vEnd[3];
    
GetClientEyePosition(entityvPos);
    
    
vEnd[0] = vPos[0];
    
vEnd[1] = vPos[1];
    
vEnd[2] = vPos[2] + 50.0;
    
    static 
Handle tr;
    
tr TR_TraceRayFilterEx(vPosvEndMASK_VISIBLERayType_EndPointTraceFilter_NoSelfentity);
    if (
TR_DidHit(tr))
    {
        if (
TR_GetSurfaceFlags(tr) & (SURF_SKY2D|SURF_SKY))
        {
            
SetEntPropFloat(abilityProp_Send"m_lungeAgainTimer", -1.01);
        }
    }
    
    
delete tr;
}

bool TraceFilter_NoSelf(int entityint contentsMaskany 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.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_backjump_fix.sp - 94 views - 3.8 KB)

Last edited by Forgetest; 07-07-2022 at 15:43.
Forgetest is offline