From 5525af3769e7289a50ca0c6b316f763e63f91cff Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 28 Jan 2024 21:50:25 +0300 Subject: [PATCH] engine: server: add SOLID_GIB extension from TimeWarp that disables interactions for gibs except for the solid brushes --- common/const.h | 1 + engine/server/sv_phys.c | 4 ++-- engine/server/sv_world.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/const.h b/common/const.h index bd65b7d5..628dbf18 100644 --- a/common/const.h +++ b/common/const.h @@ -92,6 +92,7 @@ #define SOLID_BSP 4 // bsp clip, touch on edge, block #define SOLID_CUSTOM 5 // call external callbacks for tracing #define SOLID_PORTAL 6 // borrowed from FTE +#define SOLID_GIB 7 // do not block, only collide with solid brushes // edict->deadflag values #define DEAD_NO 0 // alive diff --git a/engine/server/sv_phys.c b/engine/server/sv_phys.c index 5709e616..0a9f41c6 100644 --- a/engine/server/sv_phys.c +++ b/engine/server/sv_phys.c @@ -802,7 +802,7 @@ static trace_t SV_PushEntity( edict_t *ent, const vec3_t lpush, const vec3_t apu if( ent->v.movetype == MOVETYPE_FLYMISSILE ) type = MOVE_MISSILE; - else if( ent->v.solid == SOLID_TRIGGER || ent->v.solid == SOLID_NOT ) + else if( ent->v.solid == SOLID_TRIGGER || ent->v.solid == SOLID_NOT || ent->v.solid == SOLID_GIB ) type = MOVE_NOMONSTERS; // only clip against bmodels else type = MOVE_NORMAL; @@ -878,7 +878,7 @@ static qboolean SV_CanBlock( edict_t *ent ) if( ent->v.mins[0] == ent->v.maxs[0] ) return false; - if( ent->v.solid == SOLID_NOT || ent->v.solid == SOLID_TRIGGER ) + if( ent->v.solid == SOLID_NOT || ent->v.solid == SOLID_TRIGGER || ent->v.solid == SOLID_GIB ) { // clear bounds for deadbody ent->v.mins[0] = ent->v.mins[1] = 0; diff --git a/engine/server/sv_world.c b/engine/server/sv_world.c index 8cb9fa62..1cca21e0 100644 --- a/engine/server/sv_world.c +++ b/engine/server/sv_world.c @@ -1069,7 +1069,7 @@ static qboolean SV_ClipToEntity( edict_t *touch, moveclip_t *clip ) return true; } - if( touch == clip->passedict || touch->v.solid == SOLID_NOT ) + if( touch == clip->passedict || touch->v.solid == SOLID_NOT || touch->v.solid == SOLID_GIB ) return true; if( touch->v.solid == SOLID_TRIGGER )