From 0c95e86089dc49b8097bd12374594b691159d122 Mon Sep 17 00:00:00 2001 From: Artem Golubikhin Date: Sat, 15 Jul 2017 18:15:39 +0300 Subject: [PATCH] Fixed GetHullBounds (#172) --- regamedll/dlls/client.cpp | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index a023c12c..66275a01 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -4601,9 +4601,46 @@ int EXT_FUNC ConnectionlessPacket(const struct netadr_s *net_from, const char *a return 0; } +// TODO: int -> qboolean or enum int EXT_FUNC GetHullBounds(int hullnumber, float *mins, float *maxs) { - return hullnumber < 3; +#ifdef REGAMEDLL_FIXES + switch (hullnumber) + { + case 0: // Normal player + Q_memcpy(mins, (float*)VEC_HULL_MIN, sizeof(vec3_t)); + Q_memcpy(maxs, (float*)VEC_HULL_MAX, sizeof(vec3_t)); + return TRUE; + case 1: // Crouched player + Q_memcpy(mins, (float*)VEC_DUCK_HULL_MIN, sizeof(vec3_t)); + Q_memcpy(maxs, (float*)VEC_DUCK_HULL_MAX, sizeof(vec3_t)); + return TRUE; + case 2: // Point based hull + Q_memcpy(mins, (float*)Vector(0, 0, 0), sizeof(vec3_t)); + Q_memcpy(maxs, (float*)Vector(0, 0, 0), sizeof(vec3_t)); + return TRUE; + default: + return FALSE; + } +#else // REGAMEDLL_FIXES + switch (hullnumber) + { + case 0: // Normal player + mins = VEC_HULL_MIN; + maxs = VEC_HULL_MAX; + return TRUE; + case 1: // Crouched player + mins = VEC_DUCK_HULL_MIN; + maxs = VEC_DUCK_HULL_MAX; + return TRUE; + case 2: // Point based hull + mins = Vector(0, 0, 0); + maxs = Vector(0, 0, 0); + return TRUE; + default: + return FALSE; + } +#endif // REGAMEDLL_FIXES } // Create pseudo-baselines for items that aren't placed in the map at spawn time, but which are likely