Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
videoP committed Apr 11, 2024
1 parent 40e8344 commit 3fb5934
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion codemp/game/bg_slidemove.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,9 @@ qboolean PM_SlideMove( qboolean gravity ) {
// slide along the plane
PM_ClipVelocity (endVelocity, planes[i], endClipVelocity, OVERCLIP );
#if 1
if (pm->ps->stats[STAT_MOVEMENTSTYLE] == MV_TRIBES && (pml.groundTrace.surfaceFlags & MATERIAL_MASK) == MATERIAL_SHORTGRASS && (planes[i][2] == 0 || planes[i][2] == 1)) {//Vert collision in tribes mode
if (pm->ps->stats[STAT_MOVEMENTSTYLE] == MV_TRIBES &&
(((pml.groundTrace.surfaceFlags & MATERIAL_MASK) >= MATERIAL_SHORTGRASS && (pml.groundTrace.surfaceFlags & MATERIAL_MASK) <= MATERIAL_GRAVEL) || ((pml.groundTrace.surfaceFlags & MATERIAL_MASK) == MATERIAL_MUD) || ((pml.groundTrace.surfaceFlags & MATERIAL_MASK) == MATERIAL_ROCK)) &&
(planes[i][2] == 0 || planes[i][2] == 1)) {//Vertical or horizontal brush collision in tribes mode
//For some reason I have to use pml.groundtrace results instead of trace results because trace results dont see the surfaceflags or contents (???). Need to add more material types for terrain detection. Or make use of surfaceparm terrain instead in the future.
pm->ps->pm_time = 250;
//Com_Printf("^3Deadstop detection! Mitigating! Contents is %i %i %i %i\n", trace.surfaceFlags & MATERIAL_MASK, pml.groundTrace.surfaceFlags & MATERIAL_MASK, trace.contents & CONTENTS_INSIDE, pml.groundTrace.contents & CONTENTS_INSIDE);
Expand Down

0 comments on commit 3fb5934

Please sign in to comment.