Remove disgusting and broken Developer_searchpath() function.

It's mush better and safer to query the "game" cvar instead. It's always
set to the mods name and get's the baseq2 special case right.
This commit is contained in:
Yamagi Burmeister 2017-08-04 09:20:44 +02:00
parent ff7772f11d
commit db2cde0325
2 changed files with 6 additions and 27 deletions

View file

@ -93,8 +93,6 @@ S_RegisterSexedModel(entity_state_t *ent, char *base)
return md2; return md2;
} }
extern int Developer_searchpath(int who);
void void
CL_AddPacketEntities(frame_t *frame) CL_AddPacketEntities(frame_t *frame)
{ {
@ -108,6 +106,9 @@ CL_AddPacketEntities(frame_t *frame)
clientinfo_t *ci; clientinfo_t *ci;
unsigned int effects, renderfx; unsigned int effects, renderfx;
/* To distinguish baseq2, xatrix and rogue. */
cvar_t *game = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
/* bonus items rotate at a fixed rate */ /* bonus items rotate at a fixed rate */
autorotate = anglemod(cl.time * 0.1f); autorotate = anglemod(cl.time * 0.1f);
@ -377,7 +378,7 @@ CL_AddPacketEntities(frame_t *frame)
something special */ something special */
if (renderfx & RF_SHELL_HALF_DAM) if (renderfx & RF_SHELL_HALF_DAM)
{ {
if (Developer_searchpath(2) == 2) if (strcmp(game->string, "rogue") == 0)
{ {
/* ditch the half damage shell if any of red, blue, or double are on */ /* ditch the half damage shell if any of red, blue, or double are on */
if (renderfx & (RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_DOUBLE)) if (renderfx & (RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_DOUBLE))
@ -389,7 +390,7 @@ CL_AddPacketEntities(frame_t *frame)
if (renderfx & RF_SHELL_DOUBLE) if (renderfx & RF_SHELL_DOUBLE)
{ {
if (Developer_searchpath(2) == 2) if (strcmp(game->string, "rogue") == 0)
{ {
/* lose the yellow shell if we have a red, blue, or green shell */ /* lose the yellow shell if we have a red, blue, or green shell */
if (renderfx & (RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_GREEN)) if (renderfx & (RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_GREEN))

View file

@ -330,28 +330,6 @@ FS_FCloseFile(fileHandle_t f)
memset(handle, 0, sizeof(*handle)); memset(handle, 0, sizeof(*handle));
} }
int
Developer_searchpath(int who)
{
fsSearchPath_t *search;
// TODO: Distinguish baseq from mods.
for (search = fs_searchPaths; search; search = search->next)
{
if (strstr(search->path, "xatrix"))
{
return 1;
}
if (strstr(search->path, "rogue"))
{
return 2;
}
}
return 0;
}
/* /*
* Finds the file in the search path. Returns filesize and an open FILE *. Used * Finds the file in the search path. Returns filesize and an open FILE *. Used
* for streaming data out of either a pak file or a seperate file. * for streaming data out of either a pak file or a seperate file.
@ -387,7 +365,7 @@ FS_FOpenFile(const char *name, fileHandle_t *f, qboolean gamedir_only)
// Evil hack for maps.lst and players/ // Evil hack for maps.lst and players/
// TODO: A flag to ignore paks would be better // TODO: A flag to ignore paks would be better
if ((Developer_searchpath(0) == 0) && search->pack) { if ((strcmp(fs_gamedirvar->string, "") == 0) && search->pack) {
if ((strcmp(name, "maps.lst") == 0)|| (strncmp(name, "players/", 8) == 0)) { if ((strcmp(name, "maps.lst") == 0)|| (strncmp(name, "players/", 8) == 0)) {
continue; continue;
} }