From ae451c4613d70de122929142380b47a3dcf54280 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 26 Apr 2015 16:07:49 +1000 Subject: [PATCH] Make pointer to member usage explicit --- qcsrc/client/wall.qc | 10 +++--- qcsrc/common/animdecide.qc | 12 ++++---- qcsrc/common/monsters/sv_monsters.qc | 8 ++--- qcsrc/common/util.qc | 24 +++++++-------- qcsrc/menu/item/container.qc | 12 ++++---- qcsrc/server/anticheat.qc | 18 +++++------ qcsrc/server/bot/waypoints.qc | 13 ++++---- qcsrc/server/cl_player.qc | 28 ++++++++--------- qcsrc/server/g_triggers.qc | 8 ++--- qcsrc/server/g_world.qc | 4 +-- qcsrc/server/miscfunctions.qc | 33 ++++++++++---------- qcsrc/server/playerdemo.qc | 30 +++++++++--------- qcsrc/server/scores.qc | 16 +++++----- qcsrc/server/t_items.qc | 44 +++++++++++++-------------- qcsrc/server/vehicles/vehicles.qc | 12 ++++---- qcsrc/server/vehicles/vehicles_def.qh | 2 +- qcsrc/server/waypointsprites.qc | 8 ++--- qcsrc/server/weapons/throwing.qc | 12 ++++---- 18 files changed, 145 insertions(+), 149 deletions(-) diff --git a/qcsrc/client/wall.qc b/qcsrc/client/wall.qc index 1ae8fa85a..113b14b37 100644 --- a/qcsrc/client/wall.qc +++ b/qcsrc/client/wall.qc @@ -9,7 +9,7 @@ void Ent_Wall_Draw() fld = angles; else fld = origin; - self.fld = self.saved; + self.(fld) = self.saved; if(self.lodmodelindex1) { @@ -38,7 +38,7 @@ void Ent_Wall_Draw() InterpolateOrigin_Do(); - self.saved = self.fld; + self.saved = self.(fld); f = BGMScript(self); if(f >= 0) @@ -47,7 +47,7 @@ void Ent_Wall_Draw() self.alpha = 1 + self.lip * f; else // > 0: alpha goes from 1-|lip| to 1 when toggled (toggling adds lip) self.alpha = 1 - self.lip * (1 - f); - self.fld = self.fld + self.movedir * f; + self.(fld) = self.(fld) + self.movedir * f; } else self.alpha = 1; @@ -77,7 +77,7 @@ void Ent_Wall() fld = angles; else fld = origin; - self.fld = self.saved; + self.(fld) = self.saved; f = ReadByte(); @@ -169,7 +169,7 @@ void Ent_Wall() InterpolateOrigin_Note(); - self.saved = self.fld; + self.saved = self.(fld); self.entremove = Ent_Wall_Remove; self.draw = Ent_Wall_Draw; diff --git a/qcsrc/common/animdecide.qc b/qcsrc/common/animdecide.qc index ecc840f6f..0cba5d7f3 100644 --- a/qcsrc/common/animdecide.qc +++ b/qcsrc/common/animdecide.qc @@ -295,10 +295,10 @@ void animdecide_setframes(entity e, float support_blending, .float fld_frame, .f upper = lower; if(e.frame1time != upper.y || e.frame2time != lower.y) BITXOR_ASSIGN(e.effects, EF_RESTARTANIM_BIT); - e.fld_frame = upper.x; - e.fld_frame1time = upper.y; - e.fld_frame2 = lower.x; - e.fld_frame2time = lower.y; + e.(fld_frame) = upper.x; + e.(fld_frame1time) = upper.y; + e.(fld_frame2) = lower.x; + e.(fld_frame2time) = lower.y; } else { @@ -308,8 +308,8 @@ void animdecide_setframes(entity e, float support_blending, .float fld_frame, .f upper = lower; if(e.frame1time != upper.y) BITXOR_ASSIGN(e.effects, EF_RESTARTANIM_BIT); - e.fld_frame = upper.x; - e.fld_frame1time = upper.y; + e.(fld_frame) = upper.x; + e.(fld_frame1time) = upper.y; } } diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 24ea1b919..225c00fde 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -275,9 +275,9 @@ float LoadMonsterSounds(string f, float first) field = GetMonsterSoundSampleField(argv(0)); if(GetMonsterSoundSampleField_notFound) continue; - if(self.field) - strunzone(self.field); - self.field = strzone(strcat(argv(1), " ", argv(2))); + if (self.(field)) + strunzone(self.(field)); + self.(field) = strzone(strcat(argv(1), " ", argv(2))); } fclose(fh); return 1; @@ -305,7 +305,7 @@ void MonsterSound(.string samplefield, float sound_delay, float delaytoo, float if(delaytoo) if(time < self.msound_delay) return; // too early - GlobalSound(self.samplefield, chan, VOICETYPE_PLAYERSOUND); + GlobalSound(self.(samplefield), chan, VOICETYPE_PLAYERSOUND); self.msound_delay = time + sound_delay; } diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index bc516fcea..4a3b2dbf4 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -184,26 +184,26 @@ void depthfirst(entity start, .entity up, .entity downleft, .entity right, void( entity e; e = start; funcPre(pass, e); - while(e.downleft) + while (e.(downleft)) { - e = e.downleft; + e = e.(downleft); funcPre(pass, e); } funcPost(pass, e); while(e != start) { - if(e.right) + if (e.(right)) { - e = e.right; + e = e.(right); funcPre(pass, e); - while(e.downleft) + while (e.(downleft)) { - e = e.downleft; + e = e.(downleft); funcPre(pass, e); } } else - e = e.up; + e = e.(up); funcPost(pass, e); } } @@ -2539,11 +2539,11 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t // start with a 1-element queue queue_start = queue_end = e; - queue_end.fld = world; + queue_end.(fld) = world; queue_end.FindConnectedComponent_processing = 1; // for each queued item: - for (; queue_start; queue_start = queue_start.fld) + for (; queue_start; queue_start = queue_start.(fld)) { // find all neighbors of queue_start entity t; @@ -2554,16 +2554,16 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t if(iscon(t, queue_start, pass)) { // it is connected? ADD IT. It will look for neighbors soon too. - queue_end.fld = t; + queue_end.(fld) = t; queue_end = t; - queue_end.fld = world; + queue_end.(fld) = world; queue_end.FindConnectedComponent_processing = 1; } } } // unmark - for(queue_start = e; queue_start; queue_start = queue_start.fld) + for (queue_start = e; queue_start; queue_start = queue_start.(fld)) queue_start.FindConnectedComponent_processing = 0; } diff --git a/qcsrc/menu/item/container.qc b/qcsrc/menu/item/container.qc index dc369862f..b4dda3e33 100644 --- a/qcsrc/menu/item/container.qc +++ b/qcsrc/menu/item/container.qc @@ -117,9 +117,9 @@ void Container_resizeNotifyLie(entity me, vector relOrigin, vector relSize, vect float d; for(e = me.firstChild; e; e = e.nextSibling) { - o = e.originField; - s = e.sizeField; - me.enterLieSubitem(me, o, s, e.fontScaleField, e.Container_alpha); + o = e.(originField); + s = e.(sizeField); + me.enterLieSubitem(me, o, s, e.(fontScaleField), e.Container_alpha); e.resizeNotify(e, o, s, boxToGlobal(o, absOrigin, absSize), boxToGlobalSize(s, absSize)); me.leaveSubitem(me); } @@ -131,9 +131,9 @@ void Container_resizeNotifyLie(entity me, vector relOrigin, vector relSize, vect { e.resized = 0; d = 1; - o = e.originField; - s = e.sizeField; - me.enterLieSubitem(me, o, s, e.fontScaleField, e.Container_alpha); + o = e.(originField); + s = e.(sizeField); + me.enterLieSubitem(me, o, s, e.(fontScaleField), e.Container_alpha); e.resizeNotify(e, o, s, boxToGlobal(o, absOrigin, absSize), boxToGlobalSize(s, absSize)); me.leaveSubitem(me); } diff --git a/qcsrc/server/anticheat.qc b/qcsrc/server/anticheat.qc index dab5fa300..1e6759684 100644 --- a/qcsrc/server/anticheat.qc +++ b/qcsrc/server/anticheat.qc @@ -16,23 +16,23 @@ void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight) { - if(weight == 0) + if (weight == 0) return; - if(mean == 0) - e.a *= pow(value, weight); + if (mean == 0) + e.(a) *= pow(value, weight); else - e.a += pow(value, mean) * weight; - e.c += weight; + e.(a) += pow(value, mean) * weight; + e.(c) += weight; } float mean_evaluate(entity e, .float a, .float c, float mean) { - if(e.c == 0) + if (e.(c) == 0) return 0; - if(mean == 0) - return pow(e.a, 1.0 / e.c); + if (mean == 0) + return pow(e.(a), 1.0 / e.(c)); else - return pow(e.a / e.c, 1.0 / mean); + return pow(e.(a) / e.(c), 1.0 / mean); } #define MEAN_ACCUMULATE(prefix,v,w) mean_accumulate(self,prefix##_accumulator,prefix##_count,prefix##_mean,v,w) diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index 23e7af3f9..9d78cedc5 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -893,7 +893,7 @@ float botframe_autowaypoints_createwp(vector v, entity p, .entity fld, float f) w = find(w, classname, "waypoint"); } - waypoint_schedulerelink(p.fld = waypoint_spawn(v, v, f)); + waypoint_schedulerelink(p.(fld) = waypoint_spawn(v, v, f)); return 1; } @@ -948,14 +948,14 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en if(navigation_waypoint_will_link(w.origin, porg, p, walkfromwp, 1050)) { bestdist = d; - p.fld = w; + p.(fld) = w; } } w = find(w, classname, "waypoint"); } if(bestdist < maxdist) { - print("update chain to new nearest WP ", etos(p.fld), "\n"); + print("update chain to new nearest WP ", etos(p.(fld)), "\n"); return 0; } @@ -964,7 +964,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en // we know maxdist < 2100 // so wp -> porg is still valid // all is good - p.fld = wp; + p.(fld) = wp; return 0; } @@ -978,7 +978,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en setorigin(p, save); if(w) { - p.fld = w; + p.(fld) = w; return 0; } } @@ -1043,8 +1043,7 @@ float botframe_autowaypoints_fix_from(entity p, float walkfromwp, entity wp, .en .entity botframe_autowaypoints_lastwp0, botframe_autowaypoints_lastwp1; void botframe_autowaypoints_fix(entity p, float walkfromwp, .entity fld) { - float r; - r = botframe_autowaypoints_fix_from(p, walkfromwp, p.fld, fld); + float r = botframe_autowaypoints_fix_from(p, walkfromwp, p.(fld), fld); if(r != -1) return; r = botframe_autowaypoints_fix_from(p, walkfromwp, world, fld); diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index afd52171e..416fb1db7 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -767,9 +767,9 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f flood = 2; } - if(time >= source.flood_field) + if (time >= source.(flood_field)) { - source.flood_field = max(time - flood_burst * flood_spl, source.flood_field) + lines * flood_spl; + source.(flood_field) = max(time - flood_burst * flood_spl, source.(flood_field)) + lines * flood_spl; } else { @@ -779,14 +779,14 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f } else { - if(time >= source.flood_field) - source.flood_field = max(time - flood_burst * flood_spl, source.flood_field) + flood_spl; + if (time >= source.(flood_field)) + source.(flood_field) = max(time - flood_burst * flood_spl, source.(flood_field)) + flood_spl; else flood = 1; } if (timeout_status == TIMEOUT_ACTIVE) // when game is paused, no flood protection - source.flood_field = flood = 0; + source.(flood_field) = flood = 0; } if(flood == 2) // cannot happen for empty msgstr @@ -831,9 +831,9 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f } else if(flood == 1) { - if(autocvar_g_chat_flood_notify_flooder) + if (autocvar_g_chat_flood_notify_flooder) { - sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.flood_field - time), "^3 seconds\n")); + sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.(flood_field) - time), "^3 seconds\n")); ret = 0; } else @@ -1003,9 +1003,9 @@ float LoadPlayerSounds(string f, float first) field = GetVoiceMessageSampleField(argv(0)); if(GetPlayerSoundSampleField_notFound) continue; - if(self.field) - strunzone(self.field); - self.field = strzone(strcat(argv(1), " ", argv(2))); + if (self.(field)) + strunzone(self.(field)); + self.(field) = strzone(strcat(argv(1), " ", argv(2))); } fclose(fh); return 1; @@ -1200,7 +1200,7 @@ void GlobalSound(string sample, float chan, float voicetype) void PlayerSound(.string samplefield, float chan, float voicetype) { - GlobalSound(self.samplefield, chan, voicetype); + GlobalSound(self.(samplefield), chan, voicetype); } void VoiceMessage(string type, string msg) @@ -1221,10 +1221,10 @@ void VoiceMessage(string type, string msg) flood = Say(self, ownteam, world, msg, 1); - if(IS_SPEC(self) || IS_OBSERVER(self) || flood < 0) - FakeGlobalSound(self.sample, CH_VOICE, voicetype); + if (IS_SPEC(self) || IS_OBSERVER(self) || flood < 0) + FakeGlobalSound(self.(sample), CH_VOICE, voicetype); else if (flood > 0) - GlobalSound(self.sample, CH_VOICE, voicetype); + GlobalSound(self.(sample), CH_VOICE, voicetype); } void MoveToTeam(entity client, float team_colour, float type) diff --git a/qcsrc/server/g_triggers.qc b/qcsrc/server/g_triggers.qc index d58d4105e..408eaf2e7 100644 --- a/qcsrc/server/g_triggers.qc +++ b/qcsrc/server/g_triggers.qc @@ -683,11 +683,11 @@ void target_speaker_use_activator() sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1)); if(GetPlayerSoundSampleField_notFound) snd = "misc/null.wav"; - else if(activator.sample == "") + else if (activator.(sample) == "") snd = "misc/null.wav"; else { - tokenize_console(activator.sample); + tokenize_console(activator.(sample)); float n; n = stof(argv(1)); if(n > 0) @@ -710,11 +710,11 @@ void target_speaker_use_on() sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1)); if(GetPlayerSoundSampleField_notFound) snd = "misc/null.wav"; - else if(activator.sample == "") + else if (activator.(sample) == "") snd = "misc/null.wav"; else { - tokenize_console(activator.sample); + tokenize_console(activator.(sample)); float n; n = stof(argv(1)); if(n > 0) diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 712f30182..a79f3fa91 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1650,7 +1650,7 @@ void SetWinners(.float field, float value) { entity head; FOR_EACH_PLAYER(head) - head.winning = (head.field == value); + head.winning = (head.(field) == value); } // set the .winning flag for those players with a given field value @@ -1658,7 +1658,7 @@ void AddWinners(.float field, float value) { entity head; FOR_EACH_PLAYER(head) - if(head.field == value) + if (head.(field) == value) head.winning = 1; } diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 7660b7e03..3d353c75c 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -357,17 +357,17 @@ void GetCvars_handleString(string thisname, float f, .string field, string name) { if (f < 0) { - if (self.field) - strunzone(self.field); - self.field = string_null; + if (self.(field)) + strunzone(self.(field)); + self.(field) = string_null; } else if (f > 0) { if (thisname == name) { - if (self.field) - strunzone(self.field); - self.field = strzone(argv(f + 1)); + if (self.(field)) + strunzone(self.(field)); + self.(field) = strzone(argv(f + 1)); } } else @@ -379,12 +379,11 @@ void GetCvars_handleString_Fixup(string thisname, float f, .string field, string if (f >= 0) // also initialize to the fitting value for "" when sending cvars out if (thisname == name) { - string s; - s = func(strcat1(self.field)); - if (s != self.field) + string s = func(strcat1(self.(field))); + if (s != self.(field)) { - strunzone(self.field); - self.field = strzone(s); + strunzone(self.(field)); + self.(field) = strzone(s); } } } @@ -396,7 +395,7 @@ void GetCvars_handleFloat(string thisname, float f, .float field, string name) else if (f > 0) { if (thisname == name) - self.field = stof(argv(f + 1)); + self.(field) = stof(argv(f + 1)); } else stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n")); @@ -410,17 +409,17 @@ void GetCvars_handleFloatOnce(string thisname, float f, .float field, string nam { if (thisname == name) { - if(!self.field) + if (!self.(field)) { - self.field = stof(argv(f + 1)); - if(!self.field) - self.field = -1; + self.(field) = stof(argv(f + 1)); + if (!self.(field)) + self.(field) = -1; } } } else { - if(!self.field) + if (!self.(field)) stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n")); } } diff --git a/qcsrc/server/playerdemo.qc b/qcsrc/server/playerdemo.qc index 4d58a95f6..c2e812c2c 100644 --- a/qcsrc/server/playerdemo.qc +++ b/qcsrc/server/playerdemo.qc @@ -71,27 +71,27 @@ void playerdemo_open_write(string f) void playerdemo_write_originvector(.vector f, string name) { - fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n")); + fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n")); } void playerdemo_write_sizevector(.vector f, string name) { - fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n")); + fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n")); } void playerdemo_write_vector(.vector f, string name) { - fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n")); + fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n")); } void playerdemo_write_string(.string f, string name) { - fputs(self.playerdemo_fh, strcat(self.f, "\n")); + fputs(self.playerdemo_fh, strcat(self.(f), "\n")); } void playerdemo_write_modelstring(.string f, string name) { - fputs(self.playerdemo_fh, strcat(self.f, "\n")); + fputs(self.playerdemo_fh, strcat(self.(f), "\n")); } void playerdemo_write_float(.float f, string name) { - fputs(self.playerdemo_fh, strcat(ftos(self.f), "\n")); + fputs(self.playerdemo_fh, strcat(ftos(self.(f)), "\n")); } void playerdemo_write() { @@ -106,36 +106,34 @@ void playerdemo_read_originvector(.vector f, string name) } void playerdemo_read_sizevector(.vector f, string name) { - self.f = stov(fgets(self.playerdemo_fh)); + self.(f) = stov(fgets(self.playerdemo_fh)); setsize(self, self.mins, self.maxs); } void playerdemo_read_vector(.vector f, string name) { - self.f = stov(fgets(self.playerdemo_fh)); + self.(f) = stov(fgets(self.playerdemo_fh)); } void playerdemo_read_string(.string f, string name) { - string s; - s = fgets(self.playerdemo_fh); - if(s != self.f) + string s = fgets(self.playerdemo_fh); + if (s != self.(f)) { /* if(self.f) strunzone(self.f); */ - self.f = strzone(s); + self.(f) = strzone(s); } } void playerdemo_read_modelstring(.string f, string name) { - string s; - s = fgets(self.playerdemo_fh); - if(s != self.f) + string s = fgets(self.playerdemo_fh); + if (s != self.(f)) setmodel(self, s); } void playerdemo_read_float(.float f, string name) { - self.f = stof(fgets(self.playerdemo_fh)); + self.(f) = stof(fgets(self.playerdemo_fh)); } float playerdemo_read() { diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index f196220f5..a4e3245e6 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -18,29 +18,29 @@ vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, return previous; if((fieldflags & SFL_SORT_PRIO_MASK) < previous.y) return previous; - if(t1.field == t2.field) + if (t1.(field) == t2.(field)) return previous; previous.y = fieldflags & SFL_SORT_PRIO_MASK; if(fieldflags & SFL_ZERO_IS_WORST) { - if(t1.field == 0) + if (t1.(field) == 0) { previous.x = -1; return previous; } - else if(t2.field == 0) + else if (t2.(field) == 0) { previous.x = +1; return previous; } } - if(fieldflags & SFL_LOWER_IS_BETTER) - previous.x = (t2.field - t1.field); + if (fieldflags & SFL_LOWER_IS_BETTER) + previous.x = (t2.(field) - t1.(field)); else - previous.x = (t1.field - t2.field); + previous.x = (t1.(field) - t2.(field)); return previous; } @@ -699,7 +699,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat plist = world; FOR_EACH_CLIENT(p) - p.field = 0; + p.(field) = 0; FOR_EACH_CLIENT(p) if(p.scorekeeper) { @@ -739,7 +739,7 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0)) j = i; - pbest.field = j; + pbest.(field) = j; if (!pfirst) pfirst = pbest; diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 723299cc1..1a4a7586c 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -537,23 +537,23 @@ void Item_ScheduleInitialRespawn(entity e) float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode) { - if (!item.ammotype) + if (!item.(ammotype)) return false; if (item.spawnshieldtime) { - if ((player.ammotype < ammomax) || item.pickup_anyway) + if ((player.(ammotype) < ammomax) || item.pickup_anyway) { - player.ammotype = bound(player.ammotype, ammomax, player.ammotype + item.ammotype); + player.(ammotype) = bound(player.(ammotype), ammomax, player.(ammotype) + item.(ammotype)); goto YEAH; } } else if(g_weapon_stay == 2) { - float mi = min(item.ammotype, ammomax); - if (player.ammotype < mi) + float mi = min(item.(ammotype), ammomax); + if (player.(ammotype) < mi) { - player.ammotype = mi; + player.(ammotype) = mi; goto YEAH; } } @@ -1530,56 +1530,56 @@ float GiveWeapon(entity e, float wpn, float op, float val) float GiveBit(entity e, .float fld, float bit, float op, float val) { float v0, v1; - v0 = (e.fld & bit); + v0 = (e.(fld) & bit); switch(op) { case OP_SET: if(val > 0) - e.fld |= bit; + e.(fld) |= bit; else - e.fld &= ~bit; + e.(fld) &= ~bit; break; case OP_MIN: case OP_PLUS: if(val > 0) - e.fld |= bit; + e.(fld) |= bit; break; case OP_MAX: if(val <= 0) - e.fld &= ~bit; + e.(fld) &= ~bit; break; case OP_MINUS: if(val > 0) - e.fld &= ~bit; + e.(fld) &= ~bit; break; } - v1 = (e.fld & bit); + v1 = (e.(fld) & bit); return (v0 != v1); } float GiveValue(entity e, .float fld, float op, float val) { float v0, v1; - v0 = e.fld; + v0 = e.(fld); switch(op) { case OP_SET: - e.fld = val; + e.(fld) = val; break; case OP_MIN: - e.fld = max(e.fld, val); // min 100 cells = at least 100 cells + e.(fld) = max(e.(fld), val); // min 100 cells = at least 100 cells break; case OP_MAX: - e.fld = min(e.fld, val); + e.(fld) = min(e.(fld), val); break; case OP_PLUS: - e.fld += val; + e.(fld) += val; break; case OP_MINUS: - e.fld -= val; + e.(fld) -= val; break; } - v1 = e.fld; + v1 = e.(fld); return (v0 != v1); } @@ -1602,9 +1602,9 @@ void GiveSound(entity e, float v0, float v1, float t, string snd_incr, string sn void GiveRot(entity e, float v0, float v1, .float rotfield, float rottime, .float regenfield, float regentime) { if(v0 < v1) - e.rotfield = max(e.rotfield, time + rottime); + e.(rotfield) = max(e.(rotfield), time + rottime); else if(v0 > v1) - e.regenfield = max(e.regenfield, time + regentime); + e.(regenfield) = max(e.(regenfield), time + regentime); } float GiveItems(entity e, float beginarg, float endarg) { diff --git a/qcsrc/server/vehicles/vehicles.qc b/qcsrc/server/vehicles/vehicles.qc index 09beb16cc..5e6bf8dfb 100644 --- a/qcsrc/server/vehicles/vehicles.qc +++ b/qcsrc/server/vehicles/vehicles.qc @@ -860,16 +860,16 @@ void vehicles_exit(float eject) void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale) { - if(self.regen_field < field_max) - if(timer + rpause < time) + if (self.(regen_field) < field_max) + if (timer + rpause < time) { - if(_healthscale) + if (_healthscale) regen = regen * (self.vehicle_health / self.tur_health); - self.regen_field = min(self.regen_field + regen * delta_time, field_max); + self.(regen_field) = min(self.(regen_field) + regen * delta_time, field_max); - if(self.owner) - self.owner.regen_field = (self.regen_field / field_max) * 100; + if (self.owner) + self.owner.(regen_field) = (self.(regen_field) / field_max) * 100; } } diff --git a/qcsrc/server/vehicles/vehicles_def.qh b/qcsrc/server/vehicles/vehicles_def.qh index 080f891f4..20f7ade39 100644 --- a/qcsrc/server/vehicles/vehicles_def.qh +++ b/qcsrc/server/vehicles/vehicles_def.qh @@ -68,7 +68,7 @@ const float VHSF_NORMAL = 0; const float VHSF_FACTORY = 2; .void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns .float(float _imp) vehicles_impulse; -.float vehicle_weapon2mode = volly_counter; +.float vehicle_weapon2mode; #ifdef VEHICLES_USE_ODE void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object diff --git a/qcsrc/server/waypointsprites.qc b/qcsrc/server/waypointsprites.qc index 02ebdec92..d7b637d0c 100644 --- a/qcsrc/server/waypointsprites.qc +++ b/qcsrc/server/waypointsprites.qc @@ -374,11 +374,11 @@ entity WaypointSprite_Spawn( wp.team = t; wp.owner = own; wp.currentammo = hideable; - if(own) + if (own) { - if(own.ownfield) - remove(own.ownfield); - own.ownfield = wp; + if (own.(ownfield)) + remove(own.(ownfield)); + own.(ownfield) = wp; wp.owned_by_field = ownfield; } wp.fade_rate = maxdistance; diff --git a/qcsrc/server/weapons/throwing.qc b/qcsrc/server/weapons/throwing.qc index aecaafb18..0b0cb503a 100644 --- a/qcsrc/server/weapons/throwing.qc +++ b/qcsrc/server/weapons/throwing.qc @@ -107,24 +107,24 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto // if our weapon is loaded, give its load back to the player if(self.(weapon_load[self.weapon]) > 0) { - own.ammotype += self.(weapon_load[self.weapon]); + own.(ammotype) += self.(weapon_load[self.weapon]); self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading } - wep.ammotype = 0; + wep.(ammotype) = 0; } else if(doreduce) { // if our weapon is loaded, give its load back to the player if(self.(weapon_load[self.weapon]) > 0) { - own.ammotype += self.(weapon_load[self.weapon]); + own.(ammotype) += self.(weapon_load[self.weapon]); self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading } - thisammo = min(own.ammotype, wep.ammotype); - wep.ammotype = thisammo; - own.ammotype -= thisammo; + thisammo = min(own.(ammotype), wep.(ammotype)); + wep.(ammotype) = thisammo; + own.(ammotype) -= thisammo; switch(ammotype) { -- 2.39.2