From 2118e8f052b4b339da8c8feb15031de96c329dd0 Mon Sep 17 00:00:00 2001 From: Sergey Shorokhov Date: Wed, 20 Oct 2021 19:39:07 +0300 Subject: [PATCH] SV_HullForEntity: better log in `Sys_Error` (#843) --- rehlds/engine/world.cpp | 3 ++- rehlds/public/rehlds/progs.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/rehlds/engine/world.cpp b/rehlds/engine/world.cpp index 74ccc33..4cec668 100644 --- a/rehlds/engine/world.cpp +++ b/rehlds/engine/world.cpp @@ -238,7 +238,8 @@ hull_t *SV_HullForEntity(edict_t *ent, const vec_t *mins, const vec_t *maxs, vec // explicit hulls in the BSP model if (ent->v.movetype != MOVETYPE_PUSH && ent->v.movetype != MOVETYPE_PUSHSTEP) { - Sys_Error("%s: SOLID_BSP without MOVETYPE_PUSH", __func__); + Sys_Error("%s: SOLID_BSP without MOVETYPE_PUSH\nEntity classname = %s, model = %s", + __func__, STRING(ent->v.classname), STRING(ent->v.model)); } return SV_HullForBsp(ent, mins, maxs, offset); diff --git a/rehlds/public/rehlds/progs.h b/rehlds/public/rehlds/progs.h index 808ad30..5ea6cf8 100644 --- a/rehlds/public/rehlds/progs.h +++ b/rehlds/public/rehlds/progs.h @@ -68,6 +68,10 @@ struct event_state_s extern char *pr_strings; extern globalvars_t gGlobalVariables; +#if !defined(STRING) && defined(SWDS) +#define STRING(offset) ((const char *)(pr_strings + (unsigned int)(offset))) +#endif + //============================================================================ edict_t *ED_Alloc (void);