Skip to content

Conversation

@GLoOoccK
Copy link
Contributor

@justgo97
Copy link

Good addition

A quick example of an implementation:

#define FTRACE_TEAM				(1<<19)
#define FTRACE_ENEMY				(1<<20)

rg_trace_line(..., FTRACE_ENEMY)

public FMHook_ShouldCollide(entTouched, entOther) {

    ...

    if (isSameTeam(entTouched, entOther)) {
        if(global_get(glb_trace_flags) & FTRACE_ENEMY) {
                forward_return(FMV_CELL, 0)
                return FMRES_SUPERCEDE
        }
    } else {
        if(global_get(glb_trace_flags) & FTRACE_TEAM) {
                forward_return(FMV_CELL, 0)
                return FMRES_SUPERCEDE
        }
    }

    return FMRES_IGNORED
}

@dystopm
Copy link
Contributor

dystopm commented Jul 8, 2025

Good addition

A quick example of an implementation:

#define FTRACE_TEAM				(1<<19)
#define FTRACE_ENEMY				(1<<20)

rg_trace_line(..., FTRACE_ENEMY)

public FMHook_ShouldCollide(entTouched, entOther) {

    ...

    if (isSameTeam(entTouched, entOther)) {
        if(global_get(glb_trace_flags) & FTRACE_ENEMY) {
                forward_return(FMV_CELL, 0)
                return FMRES_SUPERCEDE
        }
    } else {
        if(global_get(glb_trace_flags) & FTRACE_TEAM) {
                forward_return(FMV_CELL, 0)
                return FMRES_SUPERCEDE
        }
    }

    return FMRES_IGNORED
}

You can consider add this in regamedll logic, since using an amxx script for this can be CPU consuming

@dystopm
Copy link
Contributor

dystopm commented Aug 14, 2025

Now this should work without issues when having fun module activated. alliedmodders/amxmodx#1127

@s1lentq s1lentq merged commit 4757ba6 into rehlds:master Nov 6, 2025
4 checks passed
@GLoOoccK GLoOoccK deleted the trace_line_trace_hull branch November 7, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants