mirror of
https://github.com/ioquake/ioq3.git
synced 2025-05-31 09:01:54 +00:00
Remove unused config string code from botlib
This commit is contained in:
parent
57cb0b2d89
commit
b9a33f84be
4 changed files with 1 additions and 110 deletions
|
@ -70,96 +70,6 @@ void QDECL AAS_Error(char *fmt, ...)
|
|||
// Returns: -
|
||||
// Changes Globals: -
|
||||
//===========================================================================
|
||||
char *AAS_StringFromIndex(char *indexname, char *stringindex[], int numindexes, int index)
|
||||
{
|
||||
if (!aasworld.indexessetup)
|
||||
{
|
||||
botimport.Print(PRT_ERROR, "%s: index %d not setup\n", indexname, index);
|
||||
return "";
|
||||
} //end if
|
||||
if (index < 0 || index >= numindexes)
|
||||
{
|
||||
botimport.Print(PRT_ERROR, "%s: index %d out of range\n", indexname, index);
|
||||
return "";
|
||||
} //end if
|
||||
if (!stringindex[index])
|
||||
{
|
||||
if (index)
|
||||
{
|
||||
botimport.Print(PRT_ERROR, "%s: reference to unused index %d\n", indexname, index);
|
||||
} //end if
|
||||
return "";
|
||||
} //end if
|
||||
return stringindex[index];
|
||||
} //end of the function AAS_StringFromIndex
|
||||
//===========================================================================
|
||||
//
|
||||
// Parameter: -
|
||||
// Returns: -
|
||||
// Changes Globals: -
|
||||
//===========================================================================
|
||||
int AAS_IndexFromString(char *indexname, char *stringindex[], int numindexes, char *string)
|
||||
{
|
||||
int i;
|
||||
if (!aasworld.indexessetup)
|
||||
{
|
||||
botimport.Print(PRT_ERROR, "%s: index not setup \"%s\"\n", indexname, string);
|
||||
return 0;
|
||||
} //end if
|
||||
for (i = 0; i < numindexes; i++)
|
||||
{
|
||||
if (!stringindex[i]) continue;
|
||||
if (!Q_stricmp(stringindex[i], string)) return i;
|
||||
} //end for
|
||||
return 0;
|
||||
} //end of the function AAS_IndexFromString
|
||||
//===========================================================================
|
||||
//
|
||||
// Parameter: -
|
||||
// Returns: -
|
||||
// Changes Globals: -
|
||||
//===========================================================================
|
||||
char *AAS_ModelFromIndex(int index)
|
||||
{
|
||||
return AAS_StringFromIndex("ModelFromIndex", &aasworld.configstrings[CS_MODELS], MAX_MODELS, index);
|
||||
} //end of the function AAS_ModelFromIndex
|
||||
//===========================================================================
|
||||
//
|
||||
// Parameter: -
|
||||
// Returns: -
|
||||
// Changes Globals: -
|
||||
//===========================================================================
|
||||
int AAS_IndexFromModel(char *modelname)
|
||||
{
|
||||
return AAS_IndexFromString("IndexFromModel", &aasworld.configstrings[CS_MODELS], MAX_MODELS, modelname);
|
||||
} //end of the function AAS_IndexFromModel
|
||||
//===========================================================================
|
||||
//
|
||||
// Parameter: -
|
||||
// Returns: -
|
||||
// Changes Globals: -
|
||||
//===========================================================================
|
||||
void AAS_UpdateStringIndexes(int numconfigstrings, char *configstrings[])
|
||||
{
|
||||
int i;
|
||||
//set string pointers and copy the strings
|
||||
for (i = 0; i < numconfigstrings; i++)
|
||||
{
|
||||
if (configstrings[i])
|
||||
{
|
||||
//if (aasworld.configstrings[i]) FreeMemory(aasworld.configstrings[i]);
|
||||
aasworld.configstrings[i] = (char *) GetMemory(strlen(configstrings[i]) + 1);
|
||||
strcpy(aasworld.configstrings[i], configstrings[i]);
|
||||
} //end if
|
||||
} //end for
|
||||
aasworld.indexessetup = qtrue;
|
||||
} //end of the function AAS_UpdateStringIndexes
|
||||
//===========================================================================
|
||||
//
|
||||
// Parameter: -
|
||||
// Returns: -
|
||||
// Changes Globals: -
|
||||
//===========================================================================
|
||||
int AAS_Loaded(void)
|
||||
{
|
||||
return aasworld.loaded;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue