Fixed GetHullBounds (#172)

This commit is contained in:
Artem Golubikhin 2017-07-15 18:15:39 +03:00 committed by Dmitry Novikov
parent 419603ff52
commit 0c95e86089

View File

@ -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