#include "../cl_shared.h"
#include "../../shared/parse.h"
#include "cp_rank.h"
#include "cp_campaign.h"
Go to the source code of this file.
Functions | |
int | CL_GetRankIdx (const char *rankID) |
Get the index of the given rankID in ccs.ranks array. | |
rank_t * | CL_GetRankByIdx (const int index) |
Returns a rank at an index. | |
void | CL_ParseRanks (const char *name, const char **text) |
Parse medals and ranks defined in the medals.ufo file. | |
Variables | |
static const value_t | rankValues [] |
Definition in file cp_rank.c.
rank_t* CL_GetRankByIdx | ( | const int | index | ) |
Returns a rank at an index.
[in] | index | Index of rank in ccs.ranks |
Definition at line 53 of file cp_rank.c.
References ccs, ccs_s::numRanks, and ccs_s::ranks.
Referenced by CL_UpdateCharacterStats(), CP_GetWinProbabilty(), GAME_CP_CharacterCvars(), HOS_UpdateMenu(), TR_CargoList(), TR_CheckEmployee(), and TR_TransferSelect().
int CL_GetRankIdx | ( | const char * | rankID | ) |
Get the index of the given rankID in ccs.ranks array.
[in] | rankID | Script id of the rank |
Definition at line 35 of file cp_rank.c.
References ccs, i, rank_s::id, ccs_s::numRanks, and ccs_s::ranks.
Referenced by E_CreateEmployeeAtIndex().
void CL_ParseRanks | ( | const char * | name, | |
const char ** | text | |||
) |
Parse medals and ranks defined in the medals.ufo file.
Definition at line 76 of file cp_rank.c.
References ccs, Com_EParse(), Com_EParseValue(), Com_Error(), Com_Parse(), Com_Printf(), cp_campaignPool, E_GetEmployeeType(), ERR_DROP, i, rank_s::id, MAX_RANKS, Mem_PoolStrDup, Mem_PoolStrDupTo, rank_s::name, ccs_s::numRanks, value_s::ofs, Q_strncpyz(), ccs_s::ranks, rank_s::shortname, value_s::size, value_s::string, rank_s::type, value_s::type, and V_CLIENT_HUNK_STRING.
Referenced by CL_ParseScriptFirst().
const value_t rankValues[] [static] |
{ {"name", V_TRANSLATION_STRING, offsetof(rank_t, name), 0}, {"shortname", V_TRANSLATION_STRING, offsetof(rank_t, shortname), 0}, {"image", V_CLIENT_HUNK_STRING, offsetof(rank_t, image), 0}, {"mind", V_INT, offsetof(rank_t, mind), MEMBER_SIZEOF(rank_t, mind)}, {"killed_enemies", V_INT, offsetof(rank_t, killedEnemies), MEMBER_SIZEOF(rank_t, killedEnemies)}, {"killed_others", V_INT, offsetof(rank_t, killedOthers), MEMBER_SIZEOF(rank_t, killedOthers)}, {"factor", V_FLOAT, offsetof(rank_t, factor), MEMBER_SIZEOF(rank_t, factor)}, {NULL, 0, 0, 0} }