mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 01:01:07 +00:00
a few mods use SOLID_BSP with non-bsp models for hitmesh support. We don't support that, but lets not crash out because of it.
This commit is contained in:
parent
4d5fd6c688
commit
c0d0cb81a0
1 changed files with 7 additions and 4 deletions
|
@ -139,15 +139,18 @@ hull_t *SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
|
|||
// decide which clipping hull to use, based on the size
|
||||
if (ent->v.solid == SOLID_BSP)
|
||||
{ // explicit hulls in the BSP model
|
||||
if (ent->v.movetype != MOVETYPE_PUSH)
|
||||
Host_Error ("SOLID_BSP without MOVETYPE_PUSH (%s at %f %f %f)",
|
||||
if (ent->v.movetype != MOVETYPE_PUSH && !pr_checkextension.value)
|
||||
Con_Warning ("SOLID_BSP without MOVETYPE_PUSH (%s at %f %f %f)",
|
||||
PR_GetString(ent->v.classname), ent->v.origin[0], ent->v.origin[1], ent->v.origin[2]);
|
||||
|
||||
model = sv.models[ (int)ent->v.modelindex ];
|
||||
|
||||
if (!model || model->type != mod_brush)
|
||||
Host_Error ("SOLID_BSP with a non bsp model (%s at %f %f %f)",
|
||||
{
|
||||
Con_Warning ("SOLID_BSP with a non bsp model (%s at %f %f %f)",
|
||||
PR_GetString(ent->v.classname), ent->v.origin[0], ent->v.origin[1], ent->v.origin[2]);
|
||||
goto nohitmeshsupport;
|
||||
}
|
||||
|
||||
VectorSubtract (maxs, mins, size);
|
||||
if (size[0] < 3)
|
||||
|
@ -163,7 +166,7 @@ hull_t *SV_HullForEntity (edict_t *ent, vec3_t mins, vec3_t maxs, vec3_t offset)
|
|||
}
|
||||
else
|
||||
{ // create a temp hull from bounding box sizes
|
||||
|
||||
nohitmeshsupport:
|
||||
VectorSubtract (ent->v.mins, maxs, hullmins);
|
||||
VectorSubtract (ent->v.maxs, mins, hullmaxs);
|
||||
hull = SV_HullForBox (hullmins, hullmaxs);
|
||||
|
|
Loading…
Reference in a new issue