mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 04:31:09 +00:00
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:
parent
ff7772f11d
commit
db2cde0325
2 changed files with 6 additions and 27 deletions
|
@ -93,8 +93,6 @@ S_RegisterSexedModel(entity_state_t *ent, char *base)
|
|||
return md2;
|
||||
}
|
||||
|
||||
extern int Developer_searchpath(int who);
|
||||
|
||||
void
|
||||
CL_AddPacketEntities(frame_t *frame)
|
||||
{
|
||||
|
@ -108,6 +106,9 @@ CL_AddPacketEntities(frame_t *frame)
|
|||
clientinfo_t *ci;
|
||||
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 */
|
||||
autorotate = anglemod(cl.time * 0.1f);
|
||||
|
||||
|
@ -377,7 +378,7 @@ CL_AddPacketEntities(frame_t *frame)
|
|||
something special */
|
||||
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 */
|
||||
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 (Developer_searchpath(2) == 2)
|
||||
if (strcmp(game->string, "rogue") == 0)
|
||||
{
|
||||
/* lose the yellow shell if we have a red, blue, or green shell */
|
||||
if (renderfx & (RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_GREEN))
|
||||
|
|
|
@ -330,28 +330,6 @@ FS_FCloseFile(fileHandle_t f)
|
|||
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
|
||||
* 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/
|
||||
// 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)) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue