Skip to content

Commit

Permalink
Fixed GetHullBounds (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
WPMGPRoSToTeMa authored and s1lentq committed Jul 15, 2017
1 parent 419603f commit 0c95e86
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion regamedll/dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0c95e86

Please sign in to comment.