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

View file

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

View file

@ -98,9 +98,9 @@ MapTweaks_Init(void)
}
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 */
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 */
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.
*/
typedef entity id;
/* networking helpers */
#define NETWORKED_INT(x) int x; int 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 */
typedef struct
{
string id;
string idx;
string matclass;
} hlmaterials_lut;
@ -332,7 +332,7 @@ Materials_Mapper_Init(void)
/* tokenize and just parse this stuff in */
if (tokenize_console(sTemp) == 2) {
if (argv(0) == "gamematerial") {
g_hlmlut[c].id = argv(1);
g_hlmlut[c].idx = argv(1);
g_hlmlut[c].matclass = spname;
c++;
}
@ -355,7 +355,7 @@ Materials_Mapper_Lookup(string character)
int 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 __NULL__;

View file

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