]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Declare ints as ints
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 24 Jan 2015 08:26:47 +0000 (19:26 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 24 Jan 2015 08:42:12 +0000 (19:42 +1100)
26 files changed:
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/hook.qc
qcsrc/client/laser.qc
qcsrc/client/main.qh
qcsrc/client/mapvoting.qc
qcsrc/client/modeleffects.qc
qcsrc/client/movetypes.qh
qcsrc/client/shownames.qc
qcsrc/client/tuba.qc
qcsrc/common/animdecide.qc
qcsrc/common/buffs.qh
qcsrc/common/command/generic.qh
qcsrc/common/counting.qh
qcsrc/common/mapinfo.qc
qcsrc/common/notifications.qh
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/weapons.qc
qcsrc/common/weapons/weapons.qh
qcsrc/csqcmodellib/cl_player.qc
qcsrc/csqcmodellib/cl_player.qh
qcsrc/csqcmodellib/interpolate.qc
qcsrc/server/vehicles/bumblebee.qc
qcsrc/warpzonelib/client.qc

index d6b00ec9f55182fdee763ce20adb3a7a0639d275..2ce4e92d01818b8144bc7bf80acbe7f21a381f77 100644 (file)
@@ -247,7 +247,7 @@ float SetTeam(entity o, float Team)
 
 void Playerchecker_Think()
 {
-       float i;
+    int i;
        entity e;
        for(i = 0; i < maxclients; ++i)
        {
@@ -337,7 +337,7 @@ void Ent_RemoveEntCS()
 }
 void Ent_ReadEntCS()
 {
-       float sf;
+    int sf;
        InterpolateOrigin_Undo();
 
        self.classname = "entcs_receiver";
@@ -418,7 +418,7 @@ void Ent_ReadPlayerScore()
        //      RegisterPlayer(o);
        //playerchecker will do this for us later, if it has not already done so
 
-       float sf, lf;
+    int sf, lf;
 #if MAX_SCORE <= 8
        sf = ReadByte();
        lf = ReadByte();
@@ -426,7 +426,7 @@ void Ent_ReadPlayerScore()
        sf = ReadShort();
        lf = ReadShort();
 #endif
-       float p;
+    int p;
        for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
                if(sf & p)
                {
@@ -450,7 +450,7 @@ void Ent_ReadTeamScore()
        self.team = ReadByte();
        o = self.owner = GetTeam(self.team, true); // these team numbers can always be trusted
 
-       float sf, lf;
+    int sf, lf;
 #if MAX_TEAMSCORE <= 8
        sf = ReadByte();
        lf = ReadByte();
@@ -473,10 +473,9 @@ void Ent_ReadTeamScore()
 
 void Ent_ClientData()
 {
-       float f;
        float newspectatee_status;
 
-       f = ReadByte();
+    int f = ReadByte();
 
        scoreboard_showscores_force = (f & 1);
 
@@ -523,9 +522,9 @@ void Ent_ClientData()
 
 void Ent_Nagger()
 {
-       float nags, i, j, b, f;
+    int i, j, b, f;
 
-       nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS
+    int nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS
 
        if(!(nags & 4))
        {
@@ -578,9 +577,9 @@ void Ent_Nagger()
 
 void Ent_EliminatedPlayers()
 {
-       float sf, i, j, b, f;
+    int i, j, b, f;
 
-       sf = ReadByte();
+    int sf = ReadByte();
        if(sf & 1)
        {
                for(j = 0; j < maxclients; ++j)
@@ -607,8 +606,8 @@ void Ent_RandomSeed()
 
 void Ent_ReadAccuracy(void)
 {
-       float sf, f, w, b;
-       sf = ReadInt24_t();
+    int f, w;
+    int sf = ReadInt24_t();
        if(sf == 0)
        {
                for(w = 0; w <= WEP_LAST - WEP_FIRST; ++w)
@@ -620,7 +619,7 @@ void Ent_ReadAccuracy(void)
        {
                if(sf & f)
                {
-                       b = ReadByte();
+            int b = ReadByte();
                        if(b == 0)
                                weapon_accuracy[w] = -1;
                        else if(b == 255)
@@ -927,7 +926,7 @@ void Fog_Force()
 void Gamemode_Init();
 void Ent_ScoresInfo()
 {
-       float i;
+    int i;
        self.classname = "ent_client_scores_info";
        gametype = ReadInt24_t();
        HUD_ModIcons_SetFunc();
@@ -1093,13 +1092,13 @@ void Net_ReadRace()
                        race_speedaward_alltimebest_holder = strzone(ReadString());
                        break;
                case RACE_NET_SERVER_RANKINGS:
-                       float pos, prevpos, del;
-                       pos = ReadShort();
+                       float prevpos, del;
+            int pos = ReadShort();
                        prevpos = ReadShort();
                        del = ReadShort();
 
                        // move other rankings out of the way
-                       float i;
+            int i;
                        if (prevpos) {
                                for (i=prevpos-1;i>pos-1;--i) {
                                        grecordtime[i] = grecordtime[i-1];
index d3e60207cbba7e7cf928623bbec6819b30bf442a..013fd2ee15c484d01c3cde62e1eb9d9b08fa2b4f 100644 (file)
@@ -3,7 +3,7 @@ vector polyline[16];
 void Porto_Draw()
 {
        vector p, dir, ang, q, nextdir;
-       float idx, portal_number, portal1_idx;
+       float portal_number, portal1_idx;
 
        if(activeweapon != WEP_PORTO || spectatee_status || gametype == MAPINFO_TYPE_NEXBALL)
                return;
@@ -27,7 +27,7 @@ void Porto_Draw()
        p = view_origin;
 
        polyline[0] = p;
-       idx = 1;
+       int idx = 1;
        portal_number = 0;
        nextdir = dir;
 
@@ -865,7 +865,7 @@ void UpdateCrosshair()
                                if(autocvar_crosshair_effect_time > 0)
                                {
                                        f = (time - wcross_name_changestarttime) / autocvar_crosshair_effect_time;
-                                       if (!(f < 1))
+                                       if (f >= 1)
                                        {
                                                wcross_ring_prev = ((ring_image) ? TRUE : FALSE);
                                        }
@@ -971,7 +971,8 @@ void CSQC_UpdateView(float w, float h)
 {
        entity e;
        float fov;
-       float f, i;
+       float f;
+       int i;
        vector vf_size, vf_min;
        float a;
 
index d945eda865e5c080f799f02243d3b2aeb10e7d15..9eccb08999ae2b322e3a997f764460fbe4335b81 100644 (file)
@@ -151,7 +151,7 @@ float autocvar_g_balance_damagepush_speedfactor;
 float autocvar_g_balance_tuba_attenuation;
 float autocvar_g_balance_tuba_fadetime;
 float autocvar_g_balance_tuba_volume;
-int autocvar_g_balance_tuba_pitchstep; // TODO: figure out if this should be bool or int
+int autocvar_g_balance_tuba_pitchstep;
 float autocvar_g_warmup_limit;
 bool autocvar_g_waypointsprite_uppercase;
 float autocvar_g_waypointsprite_alpha;
index 1231a3de941780541f2f67d0634a7660938c6b0f..81eefe60f929e2dfa549886ec3e89474e4a08574 100644 (file)
@@ -488,8 +488,7 @@ void CSQCModel_Effects_PostUpdate(void)
 .bool snd_looping;
 void CSQCModel_Effects_Apply(void)
 {
-       int eff = self.csqcmodel_effects;
-       eff &= ~CSQCMODEL_EF_RESPAWNGHOST;
+       int eff = self.csqcmodel_effects & ~CSQCMODEL_EF_RESPAWNGHOST;
 
        self.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS);
        self.effects = 0;
index 8b2ffca19cdb6e9997edddd5f6c566d93a7b104a..ec8029f00b49dccd7097909619942f9461a0d296 100644 (file)
@@ -190,8 +190,7 @@ void Ent_ReadHook(float bIsNew, float type)
 {
        self.HookType = type;
 
-       float sf;
-       sf = ReadByte();
+       int sf = ReadByte();
 
        self.HookSilent = (sf & 0x80);
        self.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN;
@@ -200,7 +199,7 @@ void Ent_ReadHook(float bIsNew, float type)
 
        if(sf & 1)
        {
-               float myowner = ReadByte();
+               int myowner = ReadByte();
                self.owner = playerslots[myowner - 1];
                self.sv_entnum = myowner;
                switch(self.HookType)
index f6b3fc4cbe7894392a38fd455dacbe77d800a0dc..861011f3b9f37808ec70dd2885d354b9fcd0e044 100644 (file)
@@ -1,10 +1,10 @@
 // a laser goes from origin in direction angles
 // it has color 'colormod'
 // and stops when something is in the way
-.float cnt; // end effect
+.int cnt; // end effect
 .vector colormod;
-.float state; // on-off
-.float count; // flags for the laser
+.int state; // on-off
+.int count; // flags for the laser
 .vector velocity;
 .float alpha;
 .float scale; // scaling factor of the thickness
@@ -63,11 +63,10 @@ void Draw_Laser()
 
 void Ent_Laser()
 {
-       float f;
        InterpolateOrigin_Undo();
 
        // 30 bytes, or 13 bytes for just moving
-       f = ReadByte();
+       int f = ReadByte();
        self.count = (f & 0xF0);
 
        if(self.count & 0x80)
index 87163482b2b6ebe24edf66b3615942f89bd3e164..d69a718b4b2bbca3f2bb18c0ee6bb960c226e773 100644 (file)
@@ -61,13 +61,13 @@ const float SP_SEPARATOR = -100;
 float hud_field[MAX_HUD_FIELDS + 1];
 float hud_size[MAX_HUD_FIELDS + 1];
 string hud_title[MAX_HUD_FIELDS + 1];
-float hud_num_fields;
+int hud_num_fields;
 
 string scores_label[MAX_SCORE];
-float scores_flags[MAX_SCORE];
+int scores_flags[MAX_SCORE];
 string teamscores_label[MAX_SCORE];
-float teamscores_flags[MAX_SCORE];
-.float scores[MAX_SCORE];
+int teamscores_flags[MAX_SCORE];
+.int scores[MAX_SCORE];
 .float teamscores[MAX_TEAMSCORE];
 
 #define IS_INCREASING(x) ( (x)&SFL_LOWER_IS_BETTER )
@@ -131,9 +131,9 @@ const float ALPHA_MIN_VISIBLE = 0.003;
 float armorblockpercent;
 
 //hooks
-float calledhooks;
-const float HOOK_START =    1;
-const float HOOK_END =      2;
+int calledhooks;
+const int HOOK_START =    1;
+const int HOOK_END =      2;
 
 .float ping, ping_packetloss, ping_movementloss;
 
index ac8d475529a1ef89900a7ef8287fcce8a114ea9f..dc1b8253b05ab8e9af2324747bb082a77bd64764 100644 (file)
@@ -1,4 +1,4 @@
-float mv_num_maps;
+int mv_num_maps;
 
 float mv_active;
 string mv_maps[MAPVOTE_COUNT];
@@ -17,17 +17,17 @@ float mv_top2_time;
 float mv_top2_alpha;
 
 vector mv_mousepos;
-float mv_selection;
-float mv_columns;
-float mv_mouse_selection;
-float mv_selection_keyboard;
+int mv_selection;
+int mv_columns;
+int mv_mouse_selection;
+int mv_selection_keyboard;
 
 float gametypevote;
 string mapvote_chosenmap;
 vector gtv_text_size;
 vector gtv_text_size_small;
 
-string MapVote_FormatMapItem(float id, string map, float count, float maxwidth, vector fontsize)
+string MapVote_FormatMapItem(int id, string map, float count, float maxwidth, vector fontsize)
 {
        string pre, post;
        pre = sprintf("%d. ", id+1);
@@ -52,7 +52,7 @@ string GameTypeVote_DescriptionByID(float id)
        return MapInfo_Type_Description(MapInfo_Type_FromString(mv_maps[id]));
 }
 
-vector MapVote_RGB(float id)
+vector MapVote_RGB(int id)
 {
        if(mv_avail[id] != GTV_AVAILABLE)
                return '1 1 1';
@@ -64,7 +64,7 @@ vector MapVote_RGB(float id)
                return '1 1 1';
 }
 
-void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string gtype, string pic, float count, float id)
+void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string gtype, string pic, float count, int id)
 {
        float alpha;
        float desc_padding = gtv_text_size_x * 3;
@@ -158,7 +158,7 @@ void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string g
        remove(title);
 }
 
-void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float count, float id)
+void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float count, int id)
 {
        vector img_size = '0 0 0';
        vector rgb;
@@ -213,7 +213,7 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin
                drawfill(pos, img_size, '1 1 1', 0.1, DRAWFLAG_NORMAL);
 }
 
-void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, float id)
+void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, int id)
 {
        vector rgb;
        float text_size;
@@ -231,10 +231,9 @@ void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, floa
        drawstring(pos, label, hud_fontsize, rgb, 1, DRAWFLAG_NORMAL);
 }
 
-vector MapVote_GridVec(vector gridspec, float i, float m)
+vector MapVote_GridVec(vector gridspec, int i, int m)
 {
-       float r;
-       r = i % m;
+       int r = i % m;
        return
                '1 0 0' * (gridspec_x * r)
                +
@@ -276,7 +275,8 @@ float MapVote_Selection(vector topleft, vector cellsize, float rows, float colum
 void MapVote_Draw()
 {
        string map;
-       float i, tmp;
+       int i;
+       float tmp;
        vector pos;
        float isize;
        float center;
@@ -436,7 +436,7 @@ void Cmd_MapVote_MapDownload(float argc)
        }
 }
 
-void MapVote_CheckPK3(string pic, string pk3, float id)
+void MapVote_CheckPK3(string pic, string pk3, int id)
 {
        entity pak;
        pak = spawn();
@@ -457,7 +457,7 @@ void MapVote_CheckPK3(string pic, string pk3, float id)
        }
 }
 
-void MapVote_CheckPic(string pic, string pk3, float id)
+void MapVote_CheckPic(string pic, string pk3, int id)
 {
        // never try to retrieve a pic for the "don't care" 'map'
        if(mv_abstain && id == mv_num_maps - 1)
@@ -473,10 +473,10 @@ void MapVote_CheckPic(string pic, string pk3, float id)
 
 void MapVote_ReadMask()
 {
-       float i;
+       int i;
        if ( mv_num_maps < 24 )
        {
-               float mask, power;
+               int mask, power;
                if(mv_num_maps < 8)
                        mask = ReadByte();
                else if(mv_num_maps < 16)
@@ -496,10 +496,10 @@ void MapVote_ReadMask()
 
 const float NUM_SSDIRS = 4;
 string ssdirs[NUM_SSDIRS];
-float n_ssdirs;
+int n_ssdirs;
 void MapVote_Init()
 {
-       float i, j;
+       int i, j;
        string map, pk3, s;
 
        precache_sound ("misc/invshot.wav");
@@ -608,9 +608,9 @@ void MapVote_SendChoice(float index)
        localcmd(strcat("\nimpulse ", ftos(index+1), "\n"));
 }
 
-float MapVote_MoveLeft(float pos)
+int MapVote_MoveLeft(int pos)
 {
-       float imp;
+       int imp;
        if ( pos < 0 ) 
                imp = mv_num_maps - 1;
        else
@@ -619,9 +619,9 @@ float MapVote_MoveLeft(float pos)
                imp = MapVote_MoveLeft(imp);
        return imp;
 }
-float MapVote_MoveRight(float pos)
+int MapVote_MoveRight(int pos)
 {
-       float imp;
+       int imp;
        if ( pos < 0 ) 
                imp = 0;
        else
@@ -630,9 +630,9 @@ float MapVote_MoveRight(float pos)
                imp = MapVote_MoveRight(imp);
        return imp;
 }
-float MapVote_MoveUp(float pos)
+int MapVote_MoveUp(int pos)
 {
-       float imp;
+       int imp;
        if ( pos < 0 ) 
                imp = mv_num_maps - 1;
        else
@@ -649,9 +649,9 @@ float MapVote_MoveUp(float pos)
                imp = MapVote_MoveUp(imp);
        return imp;
 }
-float MapVote_MoveDown(float pos)
+int MapVote_MoveDown(int pos)
 {
-       float imp;
+       int imp;
        if ( pos < 0 ) 
                imp = 0;
        else
@@ -750,7 +750,7 @@ void MapVote_UpdateMask()
 
 void MapVote_UpdateVotes()
 {
-       float i;
+       int i;
        for(i = 0; i < mv_num_maps; ++i)
        {
                if(mv_avail[i] == GTV_AVAILABLE)
@@ -769,9 +769,7 @@ void MapVote_UpdateVotes()
 
 void Ent_MapVote()
 {
-       float sf;
-
-       sf = ReadByte();
+       int sf = ReadByte();
 
        if(sf & 1)
                MapVote_Init();
@@ -785,8 +783,7 @@ void Ent_MapVote()
 
 void Net_MapVote_Picture()
 {
-       float type;
-       type = ReadByte();
+       int type = ReadByte();
        mv_preview[type] = true;
        mv_pics[type] = strzone(ReadPicture());
 }
index 0508a8669a984ab102530a5403c1e59a7aa20667..0f873b7e77de64b0f1958aaf571ae5e1f3c711f3 100644 (file)
@@ -22,16 +22,13 @@ void ModelEffect_Draw()
        }
 }
 
-void Ent_ModelEffect(float isNew)
+void Ent_ModelEffect(bool isNew)
 {
-       float f;
-       entity e;
-
        self.classname = "modeleffect_spawner";
 
-       f = ReadByte();
+       int f = ReadByte();
 
-       e = spawn();
+       entity e = spawn();
        e.classname = "modeleffect";
        e.model = "from network";
        e.modelindex = ReadShort();
index 46b86159e796503c45c97059baecef90574e2138..72beb6a4af66318df53509ec55965e98aaa8cb91 100644 (file)
@@ -4,7 +4,7 @@
 .vector move_angles;
 .vector move_velocity;
 .vector move_avelocity;
-.float move_flags;
+.int move_flags;
 .float move_watertype;
 .float move_waterlevel;
 .void(void) move_touch;
@@ -20,21 +20,21 @@ void Movetype_Physics_MatchTicrate(float tr, bool sloppy);
 void Movetype_Physics_MatchServer(bool sloppy);
 void Movetype_Physics_NoMatchServer();
 
-const float    MOVETYPE_NONE                           = 0;
-const float    MOVETYPE_ANGLENOCLIP                    = 1;
-const float    MOVETYPE_ANGLECLIP                      = 2;
-const float    MOVETYPE_WALK                           = 3;
-const float    MOVETYPE_STEP                           = 4;
-const float    MOVETYPE_FLY                            = 5;
-const float    MOVETYPE_TOSS                           = 6;
-const float    MOVETYPE_PUSH                           = 7;
-const float    MOVETYPE_NOCLIP                         = 8;
-const float    MOVETYPE_FLYMISSILE                     = 9;
-const float    MOVETYPE_BOUNCE                         = 10;
-const float    MOVETYPE_BOUNCEMISSILE  = 11;   // Like bounce but doesn't lose speed on bouncing
-const float MOVETYPE_FOLLOW = 12;
-const float MOVETYPE_FAKEPUSH = 13;
-const float MOVETYPE_FLY_WORLDONLY = 33;
+const int MOVETYPE_NONE                                = 0;
+const int MOVETYPE_ANGLENOCLIP     = 1;
+const int MOVETYPE_ANGLECLIP       = 2;
+const int MOVETYPE_WALK                                = 3;
+const int MOVETYPE_STEP                                = 4;
+const int MOVETYPE_FLY                         = 5;
+const int MOVETYPE_TOSS                                = 6;
+const int MOVETYPE_PUSH                                = 7;
+const int MOVETYPE_NOCLIP                  = 8;
+const int MOVETYPE_FLYMISSILE      = 9;
+const int MOVETYPE_BOUNCE                  = 10;
+const int MOVETYPE_BOUNCEMISSILE       = 11;   // Like bounce but doesn't lose speed on bouncing
+const int MOVETYPE_FOLLOW           = 12;
+const int MOVETYPE_FAKEPUSH         = 13;
+const int MOVETYPE_FLY_WORLDONLY    = 33;
 
-const float   FL_ITEM                 = 256;
-const float    FL_ONGROUND                             = 512;
+const int FL_ITEM                   = 256;
+const int FL_ONGROUND                          = 512;
index 4a948ca2e845b804d586f44d997bb5e8b419e308..8aeb12a046b4ff10b169d70b23ea4eca6e742b28 100644 (file)
@@ -180,7 +180,7 @@ void Draw_ShowNames(entity ent)
 entity shownames_ent[255];
 void Draw_ShowNames_All()
 {
-       float i;
+       int i;
        for(i = 0; i < maxclients; ++i)
        {
                float t;
index cf8f881a0a535620431f0bfbf997d222475ff91e..b1eaab3aa081c76445fe84c28ba717b1a2ec011c 100644 (file)
@@ -3,13 +3,13 @@ const float TUBA_MAX =  27;
 const float TUBA_INSTRUMENTS = 3;
 
 #define TUBA_STARTNOTE(i,n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav")
-.float note; // note
+.int note; // note
 .float attenuate; // if set, attenuate it
 .float cnt; // current volume
 .float count; // initial volume
 .float tuba_instrument;
 
-float Tuba_PitchStep;
+int Tuba_PitchStep;
 
 void tubasound(entity e, float restart)
 {
@@ -117,7 +117,8 @@ void Ent_TubaNote_StopSound()
 
 void Ent_TubaNote(float bIsNew)
 {
-       float f, n, i, att, upd;
+    int f, n, i;
+       float att, upd;
        f = ReadByte();
 
        upd = 0;
@@ -178,7 +179,8 @@ void Ent_TubaNote(float bIsNew)
 
 void Tuba_Precache()
 {
-       float i, n;
+       float i;
+    int n;
        Tuba_PitchStep = autocvar_g_balance_tuba_pitchstep;
        if(Tuba_PitchStep)
        {
index ca37d2b9ee236aec3558de74c6f3cd0500055b0a..a2837343ed73f1687acb2f5af698ca65c7809847 100644 (file)
@@ -223,8 +223,7 @@ vector animdecide_getloweranim(entity e)
 
 void animdecide_setimplicitstate(entity e, float onground)
 {
-       float s;
-       s = 0;
+       int s = 0;
 
        makevectors(e.angles);
        vector v;
index c29dad6dddbc49ce5d467fe5fa0be34d3fb8b9c8..bf8b40d5dbc3e17f7ac00c85c97c983bbf329e5d 100644 (file)
@@ -2,9 +2,9 @@ entity Buff_Type_first;
 entity Buff_Type_last;
 .entity enemy; // internal next pointer
 
-var float BUFF_LAST = 1;
+float BUFF_LAST = 1;
 
-.float items; // buff ID
+.int items; // buff ID
 .string netname; // buff name
 .string message; // human readable name
 .vector colormod; // buff color
index a61986a8fb14f0739dfa7bb242ec726e55ae2dee..4f6265d154eeb24e398f3c80cbc6fc1b9f514b91 100644 (file)
@@ -17,6 +17,6 @@ string GetProgramCommandPrefix(void);
 void GenericCommand_macro_write_aliases(float fh);
 
 void Curl_URI_Get_Callback(float id, float status, string data);
-float curl_uri_get_pos;
+int curl_uri_get_pos;
 float curl_uri_get_exec[URI_GET_CURL_END - URI_GET_CURL + 1];
 string curl_uri_get_cvar[URI_GET_CURL_END - URI_GET_CURL + 1];
index 0aeabc85e7b092e9800199fd2672c9b475a0a088..4a2007cf1942272319d517b98dc445fbdf8b4dc6 100644 (file)
@@ -51,7 +51,7 @@
                ZCTX(_("CI_THI^%d seconds")), /* third */ \
                ZCTX(_("CI_MUL^%d seconds"))) /* multi */
 
-string count_ordinal(float interval)
+string count_ordinal(int interval)
 {
        // This function is designed primarily for the English language, it's impossible
        // to accomodate all languages unless we do a specific function for each one...
index ccf02e71d821387f886f6c49da96c3a77564e13a..0e8402979d101a20d769439fbf8c20a442f2114f 100644 (file)
@@ -138,7 +138,7 @@ float _MapInfo_FilterList_cmp(float i, float j, entity pass)
        return strcasecmp(a, b);
 }
 
-float MapInfo_FilterGametype(float pGametype, float pFeatures, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate)
+float MapInfo_FilterGametype(int pGametype, int pFeatures, int pFlagsRequired, int pFlagsForbidden, bool pAbortOnGenerate)
 {
        float i, j;
        if (!_MapInfo_filtered_allocated)
@@ -434,7 +434,7 @@ string _MapInfo_GetDefault(float t)
        }
 }
 
-void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, float load_default)
+void _MapInfo_Map_ApplyGametype(string s, int pWantedType, int pThisType, int load_default)
 {
        string sa;
        MapInfo_Map_supportedGametypes |= pThisType;
@@ -575,7 +575,7 @@ float _MapInfo_GetTeamPlayBool(float t)
        return FALSE;
 }
 
-void _MapInfo_Map_ApplyGametypeEx(string s, float pWantedType, float pThisType)
+void _MapInfo_Map_ApplyGametypeEx(string s, int pWantedType, int pThisType)
 {
        string sa, k, v;
        float p;
@@ -873,12 +873,13 @@ float MapInfo_isRedundant(string fn, string t)
 }
 
 // load info about a map by name into the MapInfo_Map_* globals
-float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, float pGametypeToSet)
+float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int pGametypeToSet)
 {
        string fn;
        string s, t;
        float fh;
-       float r, f, n, i, p;
+       int f, i;
+       float r, n, p;
        string acl;
 
        acl = MAPINFO_SETTEMP_ACL_USER;
@@ -1150,7 +1151,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo
        dprint("Map ", pFilename, " supports no game types, ignored\n");
        return 0;
 }
-float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametypeToSet)
+float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, int pGametypeToSet)
 {
        float r = MapInfo_Get_ByName_NoFallbacks(pFilename, pAllowGenerate, pGametypeToSet);
 
@@ -1231,8 +1232,7 @@ string MapInfo_FixName(string s)
 
 float MapInfo_CurrentFeatures()
 {
-       float req;
-       req = 0;
+       int req = 0;
        if(!(cvar("g_lms") || cvar("g_instagib") || cvar("g_overkill") || cvar("g_nix") || cvar("g_weaponarena") || !cvar("g_pickup_items") || cvar("g_race") || cvar("g_cts") || cvar("g_nexball")))
                req |= MAPINFO_FEATURE_WEAPONS;
        return req;
@@ -1240,9 +1240,8 @@ float MapInfo_CurrentFeatures()
 
 float MapInfo_CurrentGametype()
 {
-       float prev;
        entity e;
-       prev = cvar("gamecfg");
+       int prev = cvar("gamecfg");
        for(e = MapInfo_Type_first; e; e = e.enemy)
                if(cvar(e.netname))
                        if(prev != e.items)
@@ -1401,8 +1400,7 @@ void MapInfo_Shutdown()
 
 float MapInfo_ForbiddenFlags()
 {
-       float f;
-       f = MAPINFO_FLAG_FORBIDDEN;
+       int f = MAPINFO_FLAG_FORBIDDEN;
 
 #ifndef MENUQC
        if (!cvar("g_maplist_allow_hidden"))
@@ -1417,8 +1415,7 @@ float MapInfo_ForbiddenFlags()
 
 float MapInfo_RequiredFlags()
 {
-       float f;
-       f = 0;
+       int f = 0;
 
        if(cvar("g_maplist_allow_frustrating") > 1)
                f |= MAPINFO_FLAG_FRUSTRATING;
index fb4dc72308e6246e9b0645d162cd762e6d0660d3..787c4bc601be565fa7c829129bf337853b81172c 100644 (file)
@@ -1298,8 +1298,8 @@ entity msg_choice_notifs[NOTIF_CHOICE_MAX];
 .float nent_type;
 .float nent_id;
 .string nent_name;
-.float nent_stringcount;
-.float nent_floatcount;
+.int nent_stringcount;
+.int nent_floatcount;
 
 // MSG_ANNCE entity values
 .float nent_channel;
@@ -1385,7 +1385,7 @@ float notif_global_error;
 
 #define MSG_INFO_NOTIF(default,name,strnum,flnum,args,hudargs,icon,normal,gentle) \
     NOTIF_ADD_AUTOCVAR(name, default) \
-    float name; \
+    int name; \
     void RegisterNotification_##name() \
     { \
         SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_INFO_COUNT) \
index a32ce00f15e15589054b33fdfc257423c0a931e1..4c30d6e7f1174fd8e58d5825834459fccdca7f18 100644 (file)
@@ -1168,13 +1168,13 @@ void Remove_ArcBeam(void)
 
 void Ent_ReadArcBeam(float isnew)
 {
-       float sf = ReadByte();
+       int sf = ReadByte();
        entity flash;
 
        if(isnew)
        {
                // calculate shot origin offset from gun alignment
-               float gunalign = autocvar_cl_gunalign;
+               int gunalign = autocvar_cl_gunalign;
                if(gunalign != 1 && gunalign != 2 && gunalign != 4)
                        gunalign = 3; // default value
                --gunalign;
index 4f11fc3ef272ed53c5763b8f420c36553e6e7b68..e9a834f78e6df645bb10cfa078b54951309a1abe 100644 (file)
@@ -75,7 +75,7 @@ WepSet ReadWepSet()
 #endif
 
 void register_weapon(
-       float id,
+       int id,
        WepSet bit,
        float(float) func,
        .float ammotype,
@@ -148,7 +148,7 @@ void register_weapons_done()
                        weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i));
        weaponorder_byid = strzone(substring(weaponorder_byid, 1, strlen(weaponorder_byid) - 1));
 }
-entity get_weaponinfo(float id)
+entity get_weaponinfo(int id)
 {
        entity w;
        if(id < WEP_FIRST || id > WEP_LAST)
@@ -209,14 +209,14 @@ string W_NumberWeaponOrder(string order)
 
 float W_FixWeaponOrder_BuildImpulseList_buf[WEP_MAXCOUNT];
 string W_FixWeaponOrder_BuildImpulseList_order;
-void W_FixWeaponOrder_BuildImpulseList_swap(float i, float j, entity pass)
+void W_FixWeaponOrder_BuildImpulseList_swap(int i, int j, entity pass)
 {
        float h;
        h = W_FixWeaponOrder_BuildImpulseList_buf[i];
        W_FixWeaponOrder_BuildImpulseList_buf[i] = W_FixWeaponOrder_BuildImpulseList_buf[j];
        W_FixWeaponOrder_BuildImpulseList_buf[j] = h;
 }
-float W_FixWeaponOrder_BuildImpulseList_cmp(float i, float j, entity pass)
+float W_FixWeaponOrder_BuildImpulseList_cmp(int i, int j, entity pass)
 {
        entity e1, e2;
        float d;
@@ -233,7 +233,7 @@ float W_FixWeaponOrder_BuildImpulseList_cmp(float i, float j, entity pass)
 }
 string W_FixWeaponOrder_BuildImpulseList(string o)
 {
-       float i;
+       int i;
        W_FixWeaponOrder_BuildImpulseList_order = o;
        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST] = i;
index dca226f42018ec13421d15cc6b2329137ca96b8c..1b0061e6670812465e68a34327fd2fe47fcd47c9 100644 (file)
@@ -2,43 +2,43 @@
 #include "calculations.qh"
 #endif
 
-const float MAX_SHOT_DISTANCE = 32768;
+const int MAX_SHOT_DISTANCE = 32768;
 
 // weapon pickup ratings for bot logic
-const float BOT_PICKUP_RATING_LOW  =  2500;
-const float BOT_PICKUP_RATING_MID  =  5000;
-const float BOT_PICKUP_RATING_HIGH = 10000;
+const int BOT_PICKUP_RATING_LOW  =  2500;
+const int BOT_PICKUP_RATING_MID  =  5000;
+const int BOT_PICKUP_RATING_HIGH = 10000;
 
 // weapon flags
-const float WEP_TYPE_OTHER          =  0x00; // not for damaging people
-const float WEP_TYPE_SPLASH         =  0x01; // splash damage
-const float WEP_TYPE_HITSCAN        =  0x02; // hitscan
-const float WEP_TYPEMASK            =  0x0F;
-const float WEP_FLAG_CANCLIMB       =  0x10; // can be used for movement
-const float WEP_FLAG_NORMAL         =  0x20; // in "most weapons" set
-const float WEP_FLAG_HIDDEN         =  0x40; // hides from menu
-const float WEP_FLAG_RELOADABLE     =  0x80; // can has reload
-const float WEP_FLAG_SUPERWEAPON    = 0x100; // powerup timer
-const float WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag)
+const int WEP_TYPE_OTHER          =  0x00; // not for damaging people
+const int WEP_TYPE_SPLASH         =  0x01; // splash damage
+const int WEP_TYPE_HITSCAN        =  0x02; // hitscan
+const int WEP_TYPEMASK            =  0x0F;
+const int WEP_FLAG_CANCLIMB       =  0x10; // can be used for movement
+const int WEP_FLAG_NORMAL         =  0x20; // in "most weapons" set
+const int WEP_FLAG_HIDDEN         =  0x40; // hides from menu
+const int WEP_FLAG_RELOADABLE     =  0x80; // can has reload
+const int WEP_FLAG_SUPERWEAPON    = 0x100; // powerup timer
+const int WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag)
 
 // weapon requests
-const float WR_SETUP          =  1; // (SERVER) setup weapon data
-const float WR_THINK          =  2; // (SERVER) logic to run every frame
-const float WR_CHECKAMMO1     =  3; // (SERVER) checks ammo for weapon primary
-const float WR_CHECKAMMO2     =  4; // (SERVER) checks ammo for weapon second
-const float WR_AIM            =  5; // (SERVER) runs bot aiming code for this weapon
-const float WR_INIT           =  6; // (BOTH)   precaches models/sounds used by this weapon, also sets up weapon properties
-const float WR_SUICIDEMESSAGE =  7; // (SERVER) notification number for suicide message (may inspect w_deathtype for details)
-const float WR_KILLMESSAGE    =  8; // (SERVER) notification number for kill message (may inspect w_deathtype for details)
-const float WR_RELOAD         =  9; // (SERVER) handles reloading for weapon
-const float WR_RESETPLAYER    = 10; // (SERVER) clears fields that the weapon may use
-const float WR_IMPACTEFFECT   = 11; // (CLIENT) impact effect for weapon explosion
-const float WR_PLAYERDEATH    = 12; // (SERVER) called whenever a player dies
-const float WR_GONETHINK      = 13; // (SERVER) logic to run when weapon is lost
-const float WR_CONFIG         = 14; // (ALL)    dump weapon cvars to config in data directory (see: sv_cmd dumpweapons)
-const float WR_ZOOMRETICLE    = 15; // (CLIENT) weapon specific zoom reticle
-const float WR_DROP           = 16; // (SERVER) the weapon is dropped
-const float WR_PICKUP         = 17; // (SERVER) a weapon is picked up
+const int WR_SETUP          =  1; // (SERVER) setup weapon data
+const int WR_THINK          =  2; // (SERVER) logic to run every frame
+const int WR_CHECKAMMO1     =  3; // (SERVER) checks ammo for weapon primary
+const int WR_CHECKAMMO2     =  4; // (SERVER) checks ammo for weapon second
+const int WR_AIM            =  5; // (SERVER) runs bot aiming code for this weapon
+const int WR_INIT           =  6; // (BOTH)   precaches models/sounds used by this weapon, also sets up weapon properties
+const int WR_SUICIDEMESSAGE =  7; // (SERVER) notification number for suicide message (may inspect w_deathtype for details)
+const int WR_KILLMESSAGE    =  8; // (SERVER) notification number for kill message (may inspect w_deathtype for details)
+const int WR_RELOAD         =  9; // (SERVER) handles reloading for weapon
+const int WR_RESETPLAYER    = 10; // (SERVER) clears fields that the weapon may use
+const int WR_IMPACTEFFECT   = 11; // (CLIENT) impact effect for weapon explosion
+const int WR_PLAYERDEATH    = 12; // (SERVER) called whenever a player dies
+const int WR_GONETHINK      = 13; // (SERVER) logic to run when weapon is lost
+const int WR_CONFIG         = 14; // (ALL)    dump weapon cvars to config in data directory (see: sv_cmd dumpweapons)
+const int WR_ZOOMRETICLE    = 15; // (CLIENT) weapon specific zoom reticle
+const int WR_DROP           = 16; // (SERVER) the weapon is dropped
+const int WR_PICKUP         = 17; // (SERVER) a weapon is picked up
 
 // variables:
 string weaponorder_byid;
@@ -58,8 +58,8 @@ WepSet ReadWepSet();
 // weapon name macros
 #define WEP_FIRST 1
 #define WEP_MAXCOUNT 24 // Increase as needed. Can be up to three times as much.
-float WEP_COUNT;
-float WEP_LAST;
+int WEP_COUNT;
+int WEP_LAST;
 WepSet WEPSET_ALL;
 WepSet WEPSET_SUPERWEAPONS;
 
@@ -156,7 +156,7 @@ void register_weapons_done();
 .WepSet weapons;            // A: WEPSET_id // WEPSET_...
 .float(float) weapon_func;  // M: function  // w_...
 ..float ammo_field;         // M: ammotype  // main ammo field
-.float impulse;             // M: impulse   // weapon impulse
+.int impulse;               // M: impulse   // weapon impulse
 .float spawnflags;          // M: flags     // WEPSPAWNFLAG_... combined
 .float bot_pickupbasevalue; // M: rating    // bot weapon priority
 .vector wpcolor;            // M: color     // waypointsprite color
index 19fa6b9bd81dfbddf6b555f391348fc4c6f03a72..2652bd4bc1484179b08d1dc4de19c0f8cf4558bf 100644 (file)
@@ -274,7 +274,7 @@ void CSQCPlayer_SetCamera()
 
        if(view)
        {
-               var float refdefflags = 0;
+               int refdefflags = 0;
 
                if(view.csqcmodel_teleported)
                        refdefflags |= REFDEFFLAG_TELEPORTED;
index ee1a6ac4d857883fa59753c2dc89a2b7c4682f48..a9f0fd68db194471d0eb21b68684e4b0e6edcd3d 100644 (file)
@@ -27,7 +27,7 @@ const float CSQCPLAYERSTATUS_FROMSERVER = 1;
 const float CSQCPLAYERSTATUS_PREDICTED = 2;
 
 // only ever READ these!
-.float pmove_flags;
+.int pmove_flags;
 float PMF_JUMP_HELD = 1;
 float PMF_DUCKED = 4;
 float PMF_ONGROUND = 8;
index 994323cfe037334bed894624c7c12089108b069d..8d3b351c85727882c98476984316339c5482fcfe 100644 (file)
@@ -35,7 +35,7 @@ void InterpolateOrigin_Reset()
 void InterpolateOrigin_Note()
 {
        float dt;
-       float f0;
+       int f0;
 
        dt = time - self.itime2;
 
index 88b2cb2a56b61d757c24fdceb686344df1063c63..2400f800828489e9d014ba049cc76884ce9e1992 100644 (file)
@@ -1000,7 +1000,7 @@ void bumble_raygun_draw()
 
 void bumble_raygun_read(float bIsNew)
 {
-       float sf = ReadByte();
+       int sf = ReadByte();
 
        if(sf & BRG_SETUP)
        {
index 9f540bc50a9a59ce73a8ef7d04da683af9a6d4a8..a1191f8d9fba0f5c98928d1ab165118f77f938b6 100644 (file)
@@ -17,8 +17,6 @@ void WarpZone_Fade_PreDraw()
 
 void WarpZone_Read(float isnew)
 {
-       float f;
-
        warpzone_warpzones_exist = 1;
        if (!self.enemy)
        {
@@ -27,7 +25,7 @@ void WarpZone_Read(float isnew)
        }
        self.classname = "trigger_warpzone";
 
-       f = ReadByte();
+       int f = ReadByte();
        self.warpzone_isboxy = (f & 1);
        if(f & 4)
        {
@@ -84,11 +82,10 @@ void WarpZone_Read(float isnew)
 
 void WarpZone_Camera_Read(float isnew)
 {
-       float f;
        warpzone_cameras_exist = 1;
        self.classname = "func_warpzone_camera";
 
-       f = ReadByte();
+       int f = ReadByte();
        if(f & 4)
        {
                self.origin_x = ReadCoord();