Make pointer to member usage explicit
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 26 Apr 2015 06:07:49 +0000 (16:07 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 26 Apr 2015 08:04:40 +0000 (18:04 +1000)
18 files changed:
qcsrc/client/wall.qc
qcsrc/common/animdecide.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/util.qc
qcsrc/menu/item/container.qc
qcsrc/server/anticheat.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/cl_player.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/playerdemo.qc
qcsrc/server/scores.qc
qcsrc/server/t_items.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/vehicles/vehicles_def.qh
qcsrc/server/waypointsprites.qc
qcsrc/server/weapons/throwing.qc

index 1ae8fa8..113b14b 100644 (file)
@@ -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;
index ecc840f..0cba5d7 100644 (file)
@@ -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;
        }
 }
 
index 24ea1b9..225c00f 100644 (file)
@@ -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;
 }
index bc516fc..4a3b2db 100644 (file)
@@ -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;
 }
 
index dc36986..b4dda3e 100644 (file)
@@ -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);
                        }
index dab5fa3..1e67596 100644 (file)
 
 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)
index 23e7af3..9d78ced 100644 (file)
@@ -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);
index afd5217..416fb1d 100644 (file)
@@ -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)
index d58d410..408eaf2 100644 (file)
@@ -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)
index 712f301..a79f3fa 100644 (file)
@@ -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;
 }
 
index 7660b7e..3d353c7 100644 (file)
@@ -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"));
        }
 }
index 4d58a95..c2e812c 100644 (file)
@@ -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()
 {
index f196220..a4e3245 100644 (file)
@@ -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;
index 723299c..1a4a758 100644 (file)
@@ -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)
 {
index 09beb16..5e6bf8d 100644 (file)
@@ -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;
     }
 }
 
index 080f891..20f7ade 100644 (file)
@@ -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
index 02ebdec..d7b637d 100644 (file)
@@ -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;
index aecaafb..0b0cb50 100644 (file)
@@ -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)
                        {