Reserve the id keyword, fix some struct members to comply

This commit is contained in:
Marco Cawthorne 2024-07-18 13:44:52 -07:00
parent ac037bb887
commit 8b4b7f0a26
Signed by: eukara
GPG key ID: CE2032F0A2882A22
6 changed files with 26 additions and 24 deletions

View file

@ -119,7 +119,7 @@ Titles_Init(void)
string temp; string temp;
int c; int c;
int braced; int braced;
int id = 0; int titleID = 0;
InitStart(); InitStart();
@ -229,21 +229,21 @@ Titles_Init(void)
/*print(sprintf("%s\n", /*print(sprintf("%s\n",
temp));*/ temp));*/
/* time to dump the info */ /* time to dump the info */
g_titles[id].m_strName = t_name; g_titles[titleID].m_strName = t_name;
g_titles[id].m_strMessage = t_message; g_titles[titleID].m_strMessage = t_message;
g_titles[id].m_flPosX = t_position[0]; g_titles[titleID].m_flPosX = t_position[0];
g_titles[id].m_flPosY = t_position[1]; g_titles[titleID].m_flPosY = t_position[1];
g_titles[id].m_iEffect = t_effect; g_titles[titleID].m_iEffect = t_effect;
g_titles[id].m_vecColor1 = t_color; g_titles[titleID].m_vecColor1 = t_color;
g_titles[id].m_vecColor2 = t_color2; g_titles[titleID].m_vecColor2 = t_color2;
g_titles[id].m_flFadeIn = t_fadein; g_titles[titleID].m_flFadeIn = t_fadein;
g_titles[id].m_flFadeOut = t_fadeout; g_titles[titleID].m_flFadeOut = t_fadeout;
g_titles[id].m_flHoldTime = t_holdtime; g_titles[titleID].m_flHoldTime = t_holdtime;
g_titles[id].m_flFXTime = t_fxtime; g_titles[titleID].m_flFXTime = t_fxtime;
t_message = ""; t_message = "";
t_name = ""; t_name = "";
braced = FALSE; braced = FALSE;
id++; titleID++;
break; break;
default: default:
if (braced == TRUE) { if (braced == TRUE) {

View file

@ -35,11 +35,11 @@
SAVE_STATE(fieldname);\ SAVE_STATE(fieldname);\
} }
#define EVALUATE_VECTOR(fieldname, id, changedflag) {\ #define EVALUATE_VECTOR(fieldname, idx, changedflag) {\
if (VEC_CHANGED(fieldname, id)) {\ if (VEC_CHANGED(fieldname, idx)) {\
SetSendFlags(changedflag);\ SetSendFlags(changedflag);\
}\ }\
SAVE_STATE_FIELD(fieldname, id);\ SAVE_STATE_FIELD(fieldname, idx);\
} }
#define SENDENTITY_BYTE(field, changedflag) {\ #define SENDENTITY_BYTE(field, changedflag) {\

View file

@ -98,9 +98,9 @@ MapTweaks_Init(void)
} }
static bool static bool
MapTweak_Check(int id) MapTweak_Check(int num)
{ {
int segments = tokenize(g_mapTweakTable[id].cvarCheck); int segments = tokenize(g_mapTweakTable[num].cvarCheck);
/* cvars first */ /* cvars first */
for (int i = 0; i < segments; i += 3) { for (int i = 0; i < segments; i += 3) {
@ -128,7 +128,7 @@ MapTweak_Check(int id)
} }
} }
segments = tokenize(g_mapTweakTable[id].serverinfoCheck); segments = tokenize(g_mapTweakTable[num].serverinfoCheck);
/* infokeys second */ /* infokeys second */
for (int i = 0; i < segments; i += 3) { for (int i = 0; i < segments; i += 3) {

View file

@ -14,6 +14,8 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
typedef entity id;
/* networking helpers */ /* networking helpers */
#define NETWORKED_INT(x) int x; int x ##_net; #define NETWORKED_INT(x) int x; int x ##_net;
#define NETWORKED_FLOAT(x) float x; float x ##_net; #define NETWORKED_FLOAT(x) float x; float x ##_net;

View file

@ -20,7 +20,7 @@ static int g_mat_total;
/** hlmaterial to classname mapper table */ /** hlmaterial to classname mapper table */
typedef struct typedef struct
{ {
string id; string idx;
string matclass; string matclass;
} hlmaterials_lut; } hlmaterials_lut;
@ -332,7 +332,7 @@ Materials_Mapper_Init(void)
/* tokenize and just parse this stuff in */ /* tokenize and just parse this stuff in */
if (tokenize_console(sTemp) == 2) { if (tokenize_console(sTemp) == 2) {
if (argv(0) == "gamematerial") { if (argv(0) == "gamematerial") {
g_hlmlut[c].id = argv(1); g_hlmlut[c].idx = argv(1);
g_hlmlut[c].matclass = spname; g_hlmlut[c].matclass = spname;
c++; c++;
} }
@ -355,7 +355,7 @@ Materials_Mapper_Lookup(string character)
int i; int i;
for (i = 0; i < g_hlmlut_count; i++) for (i = 0; i < g_hlmlut_count; i++)
if (g_hlmlut[i].id == character) if (g_hlmlut[i].idx == character)
return g_hlmlut[i].matclass; return g_hlmlut[i].matclass;
return __NULL__; return __NULL__;

View file

@ -159,9 +159,9 @@ Sentences_GetSamples(string msg)
} }
string string
Sentences_GetString(int id) Sentences_GetString(int idx)
{ {
return g_sentences[id].m_strID; return g_sentences[idx].m_strID;
} }
#endif #endif