]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Declare more ints as ints
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 27 Jan 2015 22:10:55 +0000 (09:10 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 27 Jan 2015 22:10:55 +0000 (09:10 +1100)
24 files changed:
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/hook.qc
qcsrc/client/hud.qh
qcsrc/client/main.qh
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/movetypes.qc
qcsrc/client/particles.qc
qcsrc/client/player_skeleton.qc
qcsrc/client/player_skeleton.qh
qcsrc/client/scoreboard.qc
qcsrc/client/teamradar.qh
qcsrc/client/tturrets.qc
qcsrc/client/vehicles/vehicles.qc
qcsrc/client/wall.qc
qcsrc/common/animdecide.qh
qcsrc/common/csqcmodel_settings.qh
qcsrc/common/nades.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/dpdefs/csprogsdefs.qc
qcsrc/dpdefs/dpextensions.qc

index 604bfef524eb20691c7d62ac399d39936990204a..0e7b1415030cf6ec2db8c98d334749149c56cb43 100644 (file)
@@ -25,8 +25,8 @@ entity                world;
 float          time;
 float          frametime;
 
-float          player_localentnum;     //the entnum of the VIEW entity
-float          player_localnum;        //the playernum
+int            player_localentnum;     //the entnum of the VIEW entity
+int            player_localnum;        //the playernum
 float          maxclients;     //a constant filled in by the engine. gah, portability eh?
 
 float          clientcommandframe;     //player movement
@@ -57,7 +57,7 @@ void()                CSQC_Init;
 void()         CSQC_Shutdown;
 float(float f, float t, float n)       CSQC_InputEvent;
 void(float w, float h)         CSQC_UpdateView;
-float(string s)        CSQC_ConsoleCommand;
+bool(string s) CSQC_ConsoleCommand;
 
 //these fields are read and set by the default player physics
 vector         pmove_org;
@@ -68,7 +68,7 @@ vector                pmove_maxs;
 float          input_timelength;
 vector         input_angles;
 vector         input_movevalues;       //forwards, right, up.
-float          input_buttons;          //attack, use, jump (default physics only uses jump)
+int                    input_buttons;          //attack, use, jump (default physics only uses jump)
 
 float          movevar_gravity;
 float          movevar_stopspeed;
@@ -96,10 +96,10 @@ void                end_sys_globals;                // flag for structure dumping
 //
 // system fields (*** = do not set in prog code, maintained by C code)
 //
-.float         modelindex;             // *** model index in the precached list
+.int           modelindex;             // *** model index in the precached list
 .vector                absmin, absmax; // *** origin + mins / maxs
 
-.float         entnum; // *** the ent number as on the server
+.int           entnum; // *** the ent number as on the server
 .float         drawmask;
 .void()                predraw;
 
@@ -114,8 +114,8 @@ void                end_sys_globals;                // flag for structure dumping
 
 .string                classname;              // spawn function
 .string                model;
-.float         frame;
-.float         skin;
+.int           frame;
+.int           skin;
 .int           effects;
 
 .vector                mins, maxs;             // bounding box extents reletive to origin
@@ -168,11 +168,11 @@ float             dmg_take;
 // Basic variables
 .float enttype; // entity type sent from server
 .int   sv_entnum; // entity number sent from server
-.float team;
-.float team_size;
+.int team;
+.int team_size;
 
 float vid_conwidth, vid_conheight;
-float binddb;
+int binddb;
 
 // QUALIFYING
 float race_checkpoint;
@@ -220,8 +220,8 @@ float spectatee_status;
 string shortmapname;
 
 // database for misc stuff
-float tempdb;
-float ClientProgsDB;
+int tempdb;
+int ClientProgsDB;
 vector hook_shotorigin[4];
 vector lightning_shotorigin[4];
 
@@ -238,14 +238,14 @@ float ticrate;
 const float MIN_DAMAGEEXTRARADIUS = 2;
 const float MAX_DAMAGEEXTRARADIUS = 16;
 .float damageextraradius;
-.void(float thisdmg, float hittype, vector org, vector thisforce) event_damage;
+.void(float thisdmg, int hittype, vector org, vector thisforce) event_damage;
 
 // only for Porto
 float angles_held_status;
 vector angles_held;
 
 // weapons
-.float silent;
+.bool silent;
 
 int w_deathtype;
 float w_issilent, w_random;
@@ -269,7 +269,7 @@ int serverflags;
 
 float uid2name_dialog;
 
-.float csqcmodel_isdead; // used by shownames and miscfunctions (float getplayerisdead(float) {}) to know when a player is dead
+.bool csqcmodel_isdead; // used by shownames and miscfunctions (float getplayerisdead(float) {}) to know when a player is dead
 
 #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)
 
index 4ba741dfc255f643f461a12e00117fb1996d1799..22b814f2df6470686d11d10ebac0495bb8cb90d6 100644 (file)
@@ -10,7 +10,7 @@ void clearentity(entity e)
                clearentity_ent = spawn();
                clearentity_ent.classname = "clearentity";
        }
-       float n = e.entnum;
+       int n = e.entnum;
        copyentity(clearentity_ent, e);
        e.entnum = n;
 }
@@ -39,7 +39,7 @@ void CSQC_Init(void)
        dprintf("^4CSQC Build information: ^1%s\n", WATERMARK);
 #endif
 
-       float i;
+       int i;
 
        binddb = db_create();
        tempdb = db_create();
@@ -174,7 +174,7 @@ void Shutdown(void)
 }
 
 .float has_team;
-float SetTeam(entity o, float Team)
+float SetTeam(entity o, int Team)
 {
        entity tm;
        if(teamplay)
@@ -386,8 +386,8 @@ void Ent_RemovePlayerScore()
 
 void Ent_ReadPlayerScore()
 {
-       float i, n;
-       float isNew;
+       int i, n;
+       bool isNew;
        entity o;
 
        // damnit -.- don't want to go change every single .sv_entnum in hud.qc AGAIN
@@ -444,7 +444,7 @@ void Ent_ReadPlayerScore()
 
 void Ent_ReadTeamScore()
 {
-       float i;
+       int i;
        entity o;
 
        self.team = ReadByte();
@@ -458,7 +458,7 @@ void Ent_ReadTeamScore()
        sf = ReadShort();
        lf = ReadShort();
 #endif
-       float p;
+       int p;
        for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
                if(sf & p)
                {
@@ -1153,7 +1153,7 @@ void Net_TeamNagger()
 
 void Net_ReadPingPLReport()
 {
-       float e, pi, pl, ml;
+       int e, pi, pl, ml;
        e = ReadByte();
        pi = ReadShort();
        pl = ReadByte();
index 9a311fab98379ef9e300197eacb7b46c89e96af3..8ca0194577781c0ba622f938fc67bf22bfe38fd5 100644 (file)
@@ -484,7 +484,7 @@ void CSQCModel_Effects_PostUpdate(void)
        if(self.csqcmodel_teleported)
                Projectile_ResetTrail(self.origin);
 }
-.bool snd_looping;
+.int snd_looping;
 void CSQCModel_Effects_Apply(void)
 {
        int eff = self.csqcmodel_effects & ~CSQCMODEL_EF_RESPAWNGHOST;
index a537cbae6e87ad7e080feafb7f2b56ec22a82d80..b7c023b4d79a064e9145a657df8996022cff4ffa 100644 (file)
@@ -52,7 +52,7 @@ void Draw_GrapplingHook()
        string tex;
        vector rgb;
        float t;
-       float s;
+       int s;
        vector vs;
        float intensity, offset;
 
index 70eb08128dea3e621bb0cc4d0225879f5b442fce..85a1966baa284964e0b885a1518fda8f183e260c 100644 (file)
@@ -23,7 +23,7 @@ const float BORDER_MULTIPLIER = 0.25;
 float scoreboard_bottom;
 int weapon_accuracy[WEP_MAXCOUNT];
 
-float complain_weapon;
+int complain_weapon;
 string complain_weapon_name;
 float complain_weapon_type;
 float complain_weapon_time;
index 8b6cbac12bcb711890cbc989fd5c1d38b288bdd2..88db7ea21c4173cb76b404e753f85bce54a2ecdc 100644 (file)
@@ -44,19 +44,19 @@ float FONT_USER = 8;
 // --------------------------------------------------------------------------
 // Scoreboard stuff
 
-const float MAX_HUD_FIELDS = 16;
+const int MAX_HUD_FIELDS = 16;
 
-const float SP_END = -1;
+const int SP_END = -1;
 
-const float SP_PING = -2;
-const float SP_NAME = -3;
-const float SP_KDRATIO = -4;
-const float SP_CLRATIO = -5;
-const float SP_PL = -6;
-const float SP_FRAGS = -7;
-const float SP_SUM = -8;
+const int SP_PING = -2;
+const int SP_NAME = -3;
+const int SP_KDRATIO = -4;
+const int SP_CLRATIO = -5;
+const int SP_PL = -6;
+const int SP_FRAGS = -7;
+const int SP_SUM = -8;
 
-const float SP_SEPARATOR = -100;
+const int SP_SEPARATOR = -100;
 
 float hud_field[MAX_HUD_FIELDS + 1];
 float hud_size[MAX_HUD_FIELDS + 1];
@@ -147,4 +147,4 @@ entity entcs_receiver[255]; // 255 is the engine limit on maxclients
 
 float hud;
 float view_quality;
-float framecount;
+int framecount;
index e82961e20fc5b69779dffd0675ac533bdc169855..5bffcdee144564aef7628ad541627a2eccb8b638 100644 (file)
@@ -494,7 +494,7 @@ void MapVote_ReadMask()
        }
 }
 
-const float NUM_SSDIRS = 4;
+const int NUM_SSDIRS = 4;
 string ssdirs[NUM_SSDIRS];
 int n_ssdirs;
 void MapVote_Init()
index fcc248220d4af90ecdb4ad3131f66151e931d6c5..25741ce00e676611f8ff4c605491a5fa02d1af9e 100644 (file)
@@ -111,14 +111,12 @@ void RemoveTeam(entity Team)
 
 entity GetTeam(int Team, bool add)
 {
-       float num;
-       entity tm;
-       num = (Team == NUM_SPECTATOR) ? 16 : Team;
+       int num = (Team == NUM_SPECTATOR) ? 16 : Team;
        if(teamslots[num])
                return teamslots[num];
        if (!add)
                return world;
-       tm = spawn();
+       entity tm = spawn();
        tm.team = Team;
        teamslots[num] = tm;
        RegisterTeam(tm);
@@ -615,7 +613,7 @@ float getplayerisdead(float pl)
        return false;
 }
 
-void URI_Get_Callback(float id, float status, string data)
+void URI_Get_Callback(int id, float status, string data)
 {
        if(url_URI_Get_Callback(id, status, data))
        {
@@ -647,7 +645,7 @@ void draw_endBoldFont()
 }
 
 
-const float MAX_ACCURACY_LEVELS = 10;
+const int MAX_ACCURACY_LEVELS = 10;
 float acc_lev[MAX_ACCURACY_LEVELS];
 vector acc_col[MAX_ACCURACY_LEVELS];
 float acc_col_loadtime;
index a85ca13c2fc0213c24bb26bd702694a73544968a..a1e9a65f7a6008717266c715e72173bbcae4aedb 100644 (file)
@@ -11,7 +11,7 @@ void _Movetype_CheckVelocity() // SV_CheckVelocity
 
 float _Movetype_CheckWater(entity ent) // SV_CheckWater
 {
-       float supercontents;
+       int supercontents;
        float nativecontents;
        vector point;
 
@@ -189,10 +189,9 @@ void _Movetype_LinkEdict(float touch_triggers) // SV_LinkEdict
 float _Movetype_TestEntityPosition(vector ofs) // SV_TestEntityPosition
 {
        vector org;
-       float cont;
        org = self.move_origin + ofs;
 
-       cont = self.dphitcontentsmask;
+       int cont = self.dphitcontentsmask;
        self.dphitcontentsmask = DPCONTENTS_SOLID;
        tracebox(self.move_origin, self.mins, self.maxs, self.move_origin, MOVE_NOMONSTERS, self);
        self.dphitcontentsmask = cont;
index 578e96181b00a2167d1bc33a5eb1b22073ccdccb..a8dd10c69e14138129cc92603ec743f4d27c9467 100644 (file)
@@ -1,4 +1,4 @@
-.float dphitcontentsmask;
+.int dphitcontentsmask;
 
 .int cnt; // effect number
 .vector velocity; // particle velocity
index a0d75057adf4aee3013190b45faa33e7d84d2078..01cbfc605c0a4e3dc9ec9ffa21c494e5b9c9d730 100644 (file)
@@ -1,14 +1,14 @@
 .float skeleton_info_modelindex;
 .float skeleton_info_skin;
-const float BONETYPE_LOWER = 0;
-const float BONETYPE_UPPER = 1;
-const float MAX_BONES = 128;
+const int BONETYPE_LOWER = 0;
+const int BONETYPE_UPPER = 1;
+const int MAX_BONES = 128;
 .float skeleton_bonetype[MAX_BONES];
 .float skeleton_numbones;
 
 void skeleton_loadinfo(entity e)
 {
-       float i;
+       int i;
        if(e.skeleton_info_modelindex == e.modelindex && e.skeleton_info_skin == e.skin)
                return;
        e.bone_upperbody = 0;
@@ -56,11 +56,11 @@ void skeleton_markbones(entity e)
 {
        float s = e.skeletonindex;
        float n = (e.skeleton_numbones = skel_get_numbones(s));
-       float i;
+       int i;
        for(i = 1; i <= n; ++i)
        {
                float t = BONETYPE_LOWER;
-               float p = skel_get_boneparent(s, i);
+               int p = skel_get_boneparent(s, i);
                if(p > 0)
                        t = e.(skeleton_bonetype[p-1]);
                if(i == e.bone_upperbody)
@@ -100,7 +100,6 @@ void free_skeleton_from_frames(entity e)
 
 void skeleton_from_frames(entity e, float is_dead)
 {
-       float i;
        float m = e.modelindex;
        if(!e.skeletonindex)
        {
@@ -110,7 +109,6 @@ void skeleton_from_frames(entity e, float is_dead)
        float s = e.skeletonindex;
        if(!s)
                return;
-       float bone;
        float n = e.skeleton_numbones;
        float savelerpfrac = e.lerpfrac;
        float savelerpfrac3 = e.lerpfrac3;
@@ -129,7 +127,7 @@ void skeleton_from_frames(entity e, float is_dead)
                skel_get_boneabs(s, e.bone_upperbody);
                fixbone_oldangles = fixedvectoangles2(v_forward, v_up);
        }
-
+       int bone;
        for(bone = 0; bone < n; )
        {
                float firstbone = bone;
@@ -168,6 +166,7 @@ void skeleton_from_frames(entity e, float is_dead)
 
        if(!is_dead)
        {
+               int i;
                for(i = 0; i < MAX_AIM_BONES; ++i)
                {
                        if(e.(bone_aim[i]))
index d369bac4ec192db99f04978d17c38c28128015b4..fdf5b3dfca8dec2bcab6c7c79ff23212f0337e19 100644 (file)
@@ -3,7 +3,7 @@ void skeleton_from_frames(entity e, float is_dead);
 void skeleton_loadinfo(entity e);
 
 .float bone_upperbody;
-.float bone_weapon;
+.int bone_weapon;
 .float bone_aim[MAX_AIM_BONES];
 .float bone_aimweight[MAX_AIM_BONES];
 .float fixbone;
index 40ee14d5f616c64548f8642f80fe4902f128a1b9..5f4cbc1b801b0735ff9d493a90b946c7985a6f96 100644 (file)
@@ -134,7 +134,7 @@ int HUD_CompareScore(float vl, float vr, int f)
 
 float HUD_ComparePlayerScores(entity left, entity right)
 {
-       float vl, vr, r, i;
+       float vl, vr, r;
        vl = GetPlayerColor(left.sv_entnum);
        vr = GetPlayerColor(right.sv_entnum);
 
@@ -165,6 +165,7 @@ float HUD_ComparePlayerScores(entity left, entity right)
        if (r >= 0)
                return r;
 
+       int i;
        for(i = 0; i < MAX_SCORE; ++i)
        {
                r = HUD_CompareScore(left.scores[i], right.scores[i], scores_flags[i]);
@@ -501,7 +502,7 @@ vector hud_field_icon2_rgb;
 float hud_field_icon0_alpha;
 float hud_field_icon1_alpha;
 float hud_field_icon2_alpha;
-string HUD_GetField(entity pl, float field)
+string HUD_GetField(entity pl, int field)
 {
        float tmp, num, denom, f;
        string str;
@@ -813,7 +814,7 @@ void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_s
 
 vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size)
 {
-       float body_table_height, i;
+       float body_table_height;
        vector tmp = '0 0 0', column_dim = '0 0 0';
        entity pl;
 
@@ -868,6 +869,7 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
 
        // print the strings of the columns headers and draw the columns
        draw_beginBoldFont();
+       int i;
        for(i = 0; i < hud_num_fields; ++i)
        {
                if(hud_field[i] == SP_SEPARATOR)
index dfa92ef1c8bd8a689d514838946e19b6ce27d3b3..2ab26a343d309e4a69580c9544548ad310c108b3 100644 (file)
@@ -1,4 +1,4 @@
-const float MAX_TEAMRADAR_TIMES = 32;
+const int MAX_TEAMRADAR_TIMES = 32;
 
 // to make entities have dots on the team radar
 .float teamradar_icon;
index 440067ada15d155c3523e4afbe73fba2d5936dd2..0e509993637c9d93c9ccc64770c4e14707dffccf 100644 (file)
@@ -13,7 +13,7 @@ void turrets_precache()
     turret_precache(TID_COMMON);
 }
 
-void turret_precache(float _tid)
+void turret_precache(int _tid)
 {
     if (!turret_is_precache[TID_COMMON])
     {
@@ -596,8 +596,7 @@ void turret_die()
 
 void ent_turret()
 {
-    float sf;
-    sf = ReadByte();
+    int sf = ReadByte();
 
        if(sf & TNSF_SETUP)
        {
index 6f9a25a417b8b20b9cf05aa4b4a8ea539f69cbad..a986fa7284c1bcea95013dd17cfb8fa5b8cfa9c4 100644 (file)
@@ -208,11 +208,11 @@ void Net_VehicleSetup()
     }
 }
 #define HUD_GETSTATS \
-    int vh_health    = getstati(STAT_VEHICLESTAT_HEALTH);  \
-       int shield    = getstati(STAT_VEHICLESTAT_SHIELD);  \
+    int vh_health       = getstati(STAT_VEHICLESTAT_HEALTH);  \
+       float shield        = getstati(STAT_VEHICLESTAT_SHIELD);  \
        noref int energy    = getstati(STAT_VEHICLESTAT_ENERGY);  \
-       noref int ammo1     = getstati(STAT_VEHICLESTAT_AMMO1);   \
-       noref int reload1   = getstati(STAT_VEHICLESTAT_RELOAD1); \
+       noref float ammo1   = getstati(STAT_VEHICLESTAT_AMMO1);   \
+       noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
        noref int ammo2     = getstati(STAT_VEHICLESTAT_AMMO2);   \
        noref int reload2   = getstati(STAT_VEHICLESTAT_RELOAD2);
 
index 7b5a6b0715b5d0df58a6885de1c462bf38e311af..314e8cce3cb3f74b3f717b5e2bcb077daa4d336a 100644 (file)
@@ -1,6 +1,6 @@
 .float lip;
 .float bgmscriptangular;
-.float lodmodelindex0, lodmodelindex1, lodmodelindex2;
+.int lodmodelindex0, lodmodelindex1, lodmodelindex2;
 .float loddistance1, loddistance2;
 .vector saved;
 
index f9261adae6cc5e4cc96fcdd4108f35c2bd8b687a..58e06939246b5282ab913c83ed6d0be16ebe49b4 100644 (file)
@@ -3,7 +3,7 @@ void animdecide_load_if_needed(entity e);
 
 // client side frame inferring
 void animdecide_setimplicitstate(entity e, float onground);
-void animdecide_setframes(entity e, float support_blending, .float fld_frame, .float fld_frame1time, .float fld_frame2, .float fld_frame2time);
+void animdecide_setframes(entity e, bool support_blending, .int fld_frame, .int fld_frame1time, .int fld_frame2, .int fld_frame2time);
 
 // please network this one
 .int anim_state;
@@ -23,25 +23,25 @@ void animdecide_setframes(entity e, float support_blending, .float fld_frame, .f
 
 // explicit anim states (networked)
 void animdecide_setstate(entity e, float newstate, float restart);
-const float ANIMSTATE_DEAD1 = 1; // base frames: die1
-const float ANIMSTATE_DEAD2 = 2; // base frames: die2
-const float ANIMSTATE_DUCK = 4; // turns walk into duckwalk, jump into duckjump, etc.
-const float ANIMSTATE_FROZEN = 8; // force idle
+const int ANIMSTATE_DEAD1 = 1; // base frames: die1
+const int ANIMSTATE_DEAD2 = 2; // base frames: die2
+const int ANIMSTATE_DUCK = 4; // turns walk into duckwalk, jump into duckjump, etc.
+const int ANIMSTATE_FROZEN = 8; // force idle
 
 // implicit anim states (inferred from velocity, etc.)
-const float ANIMIMPLICITSTATE_INAIR = 1;
-const float ANIMIMPLICITSTATE_FORWARD = 2;
-const float ANIMIMPLICITSTATE_BACKWARDS = 4;
-const float ANIMIMPLICITSTATE_LEFT = 8;
-const float ANIMIMPLICITSTATE_RIGHT = 16;
-const float ANIMIMPLICITSTATE_JUMPRELEASED = 32;
+const int ANIMIMPLICITSTATE_INAIR = 1;
+const int ANIMIMPLICITSTATE_FORWARD = 2;
+const int ANIMIMPLICITSTATE_BACKWARDS = 4;
+const int ANIMIMPLICITSTATE_LEFT = 8;
+const int ANIMIMPLICITSTATE_RIGHT = 16;
+const int ANIMIMPLICITSTATE_JUMPRELEASED = 32;
 
 // explicit actions (networked); negative values are for lower body
 void animdecide_setaction(entity e, float action, float restart);
-const float ANIMACTION_JUMP = -1; // jump
-const float ANIMACTION_DRAW = 1; // draw
-const float ANIMACTION_PAIN1 = 2; // pain
-const float ANIMACTION_PAIN2 = 3; // pain
-const float ANIMACTION_SHOOT = 4; // shoot
-const float ANIMACTION_TAUNT = 5; // taunt
-const float ANIMACTION_MELEE = 6; // melee
+const int ANIMACTION_JUMP = -1; // jump
+const int ANIMACTION_DRAW = 1; // draw
+const int ANIMACTION_PAIN1 = 2; // pain
+const int ANIMACTION_PAIN2 = 3; // pain
+const int ANIMACTION_SHOOT = 4; // shoot
+const int ANIMACTION_TAUNT = 5; // taunt
+const int ANIMACTION_MELEE = 6; // melee
index 16fd950b4e4bba8c56b954f0009c90fe42b6cb22..54ef11117e67359683a258fb33f0421941cf7e7f 100644 (file)
@@ -22,9 +22,9 @@
 
 // add properties you want networked to CSQC here
 #define CSQCMODEL_EXTRAPROPERTIES \
-       CSQCMODEL_PROPERTY(1, float, ReadShort, WriteShort, colormap) \
-       CSQCMODEL_PROPERTY(2, float, ReadInt24_t, WriteInt24_t, effects) \
-       CSQCMODEL_PROPERTY(4, float, ReadByte, WriteByte, modelflags) \
+       CSQCMODEL_PROPERTY(1, int, ReadShort, WriteShort, colormap) \
+       CSQCMODEL_PROPERTY(2, int, ReadInt24_t, WriteInt24_t, effects) \
+       CSQCMODEL_PROPERTY(4, int, ReadByte, WriteByte, modelflags) \
        CSQCMODEL_PROPERTY_SCALED(8, float, ReadByte, WriteByte, alpha, 254, -1, 254) \
        CSQCMODEL_PROPERTY(16, float, ReadByte, WriteByte, skin) \
        CSQCMODEL_PROPERTY(32, float, ReadApproxPastTime, WriteApproxPastTime, death_time) \
index 1004e1ecab63cf9d61ea094bc2dec2a15cf48f5f..b87375808d8e5641122492d988d65809d71b531a 100644 (file)
@@ -1,29 +1,29 @@
 // use slots 70-100
-const float PROJECTILE_NADE = 71;
-const float PROJECTILE_NADE_BURN = 72;
-const float PROJECTILE_NADE_NAPALM = 73;
-const float PROJECTILE_NADE_NAPALM_BURN = 74;
-const float PROJECTILE_NAPALM_FOUNTAIN = 75;
-const float PROJECTILE_NADE_ICE = 76;
-const float PROJECTILE_NADE_ICE_BURN = 77;
-const float PROJECTILE_NADE_TRANSLOCATE = 78;
-const float PROJECTILE_NADE_SPAWN = 79;
-const float PROJECTILE_NADE_HEAL = 80;
-const float PROJECTILE_NADE_HEAL_BURN = 81;
-const float PROJECTILE_NADE_MONSTER = 82;
-const float PROJECTILE_NADE_MONSTER_BURN = 83;
+const int PROJECTILE_NADE = 71;
+const int PROJECTILE_NADE_BURN = 72;
+const int PROJECTILE_NADE_NAPALM = 73;
+const int PROJECTILE_NADE_NAPALM_BURN = 74;
+const int PROJECTILE_NAPALM_FOUNTAIN = 75;
+const int PROJECTILE_NADE_ICE = 76;
+const int PROJECTILE_NADE_ICE_BURN = 77;
+const int PROJECTILE_NADE_TRANSLOCATE = 78;
+const int PROJECTILE_NADE_SPAWN = 79;
+const int PROJECTILE_NADE_HEAL = 80;
+const int PROJECTILE_NADE_HEAL_BURN = 81;
+const int PROJECTILE_NADE_MONSTER = 82;
+const int PROJECTILE_NADE_MONSTER_BURN = 83;
 
-const float NADE_TYPE_NORMAL = 1;
-const float NADE_TYPE_NAPALM = 2;
-const float NADE_TYPE_ICE = 3;
-const float NADE_TYPE_TRANSLOCATE = 4;
-const float NADE_TYPE_SPAWN = 5;
-const float NADE_TYPE_HEAL = 6;
-const float NADE_TYPE_MONSTER = 7;
+const int NADE_TYPE_NORMAL = 1;
+const int NADE_TYPE_NAPALM = 2;
+const int NADE_TYPE_ICE = 3;
+const int NADE_TYPE_TRANSLOCATE = 4;
+const int NADE_TYPE_SPAWN = 5;
+const int NADE_TYPE_HEAL = 6;
+const int NADE_TYPE_MONSTER = 7;
 
-const float NADE_TYPE_LAST = 7; // a check to prevent using higher values & crashing
+const int NADE_TYPE_LAST = 7; // a check to prevent using higher values & crashing
 
-vector Nade_Color(float nadeid)
+vector Nade_Color(int nadeid)
 {
        switch(nadeid)
        {
@@ -39,7 +39,7 @@ vector Nade_Color(float nadeid)
        return '0 0 0';
 }
 
-float Nade_IDFromProjectile(float proj)
+int Nade_IDFromProjectile(float proj)
 {
        switch(proj)
        {
@@ -60,7 +60,7 @@ float Nade_IDFromProjectile(float proj)
        return 0;
 }
 
-float Nade_ProjectileFromID(float proj, float burn)
+int Nade_ProjectileFromID(int proj, bool burn)
 {
        switch(proj)
        {
index 5e200afeb117c8985308a27f3314695c27a1d0f3..7b3df7f77ccb9ad0e577162a441173021db00642 100644 (file)
@@ -248,10 +248,9 @@ string fstrunzone(string s)
        return sc;
 }
 
-float fexists(string f)
+bool fexists(string f)
 {
-    float fh;
-    fh = fopen(f, FILE_READ);
+    int fh = fopen(f, FILE_READ);
     if (fh < 0)
         return false;
     fclose(fh);
@@ -1884,7 +1883,7 @@ string getcurrentmod()
 
 #ifndef MENUQC
 #ifdef CSQC
-float ReadInt24_t()
+int ReadInt24_t()
 {
        float v;
        v = ReadShort() * 256; // note: this is signed
@@ -2780,7 +2779,7 @@ float Announcer_PickNumber(float type, float num)
 #endif
 
 #ifndef MENUQC
-float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents)
+int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents)
 {
        switch(nativecontents)
        {
@@ -2800,7 +2799,7 @@ float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents)
        return 0;
 }
 
-float Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents)
+int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents)
 {
        if(supercontents & (DPCONTENTS_SOLID | DPCONTENTS_BODY))
                return CONTENT_SOLID;
index 6cac5fa56ce856c0afd6602d954bd1d705d7b646..3d4e9b9e9ea673d1a30207930b0485b9158d8834 100644 (file)
@@ -71,7 +71,7 @@ float median(float a, float b, float c);
 // works for up to 10 decimals!
 string ftos_decimals(float number, float decimals);
 
-float fexists(string f);
+bool fexists(string f);
 
 vector colormapPaletteColor(float c, float isPants);
 
@@ -222,7 +222,7 @@ string getcurrentmod();
 
 #ifndef MENUQC
 #ifdef CSQC
-float ReadInt24_t();
+int ReadInt24_t();
 vector ReadInt48_t();
 vector ReadInt72_t();
 #else
@@ -262,7 +262,7 @@ float get_model_parameters_age;
 string get_model_parameters_description;
 string get_model_parameters_bone_upperbody;
 string get_model_parameters_bone_weapon;
-const float MAX_AIM_BONES = 4;
+const int MAX_AIM_BONES = 4;
 string get_model_parameters_bone_aim[MAX_AIM_BONES];
 float get_model_parameters_bone_aimweight[MAX_AIM_BONES];
 float get_model_parameters_fixbone;
@@ -430,8 +430,8 @@ float Announcer_PickNumber(float type, float num);
 #endif
 
 #ifndef MENUQC
-float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents);
-float Mod_Q1BSP_NativeContentsFromSuperContents(float supercontents);
+int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents);
+int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents);
 #endif
 
 // Quadratic splines (bezier)
index 8a5031291560c85e425c7fae589e3193fc8d3def..3fc4e61ae2d99ff1e76ba605395e4399ae11e623 100644 (file)
@@ -48,7 +48,7 @@ void()                CSQC_Init;
 void()         CSQC_Shutdown;
 float(float f, float t, float n)       CSQC_InputEvent;
 void(float w, float h)         CSQC_UpdateView;
-float(string s)        CSQC_ConsoleCommand;
+bool(string s) CSQC_ConsoleCommand;
 
 //these fields are read and set by the default player physics
 vector         pmove_org;
@@ -88,7 +88,7 @@ void          end_sys_globals;                // flag for structure dumping
 //
 // system fields (*** = do not set in prog code, maintained by C code)
 //
-.float         modelindex;             // *** model index in the precached list
+.int           modelindex;             // *** model index in the precached list
 .vector                absmin, absmax; // *** origin + mins / maxs
 
 .int           entnum; // *** the ent number as on the server
@@ -106,8 +106,8 @@ void                end_sys_globals;                // flag for structure dumping
 
 .string                classname;              // spawn function
 .string                model;
-.float         frame;
-.float         skin;
+.int           frame;
+.int           skin;
 .int           effects;
 
 .vector                mins, maxs;             // bounding box extents reletive to origin
@@ -419,7 +419,7 @@ entity(entity start, .float fld, float match) findfloat = #98;
 float(string s) checkextension = #99;
 // FrikaC and Telejano range #100-#199
 
-float(string filename, float mode) fopen = #110;
+int(string filename, int mode) fopen = #110;
 void(float fhandle) fclose = #111;
 string(float fhandle) fgets = #112;
 void(float fhandle, string s) fputs = #113;
@@ -479,12 +479,12 @@ void(void) drawresetcliparea = #325;
 float(vector position, string text, vector scale, float alpha, float flag) drawcolorcodedstring = #326;
 vector(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawcolorcodedstring2 = #326;
 
-float(float stnum) getstatf = #330;
-float(float stnum, ...) getstati = #331; // can optionally take first bit and count
+float(int stnum) getstatf = #330;
+int(int stnum, ...) getstati = #331; // can optionally take first bit and count
 string(float firststnum) getstats = #332;
 void(entity e, float mdlindex) setmodelindex = #333;
 string(float mdlindex) modelnameforindex = #334;
-float(string effectname) particleeffectnum = #335;
+int(string effectname) particleeffectnum = #335;
 void(entity ent, float effectnum, vector start, vector end) trailparticles = #336;
 //void(float effectnum, vector origin [, vector dir, float count]) pointparticles = #337;
 void(float effectnum, vector origin , vector dir, float count) pointparticles = #337;
@@ -558,7 +558,7 @@ string(entity e, float s) getsurfacetexture = #437;
 float(entity e, vector p) getsurfacenearpoint = #438;
 vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
 
-float(string s) tokenize = #441;
+int(string s) tokenize = #441;
 string(float n) argv = #442;
 void(entity e, entity tagentity, string tagname) setattachment = #443;
 float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
@@ -568,7 +568,7 @@ string(float handle, float num) search_getfilename = #447;
 string(string s) cvar_string = #448;
 entity(entity start, .float fld, float match) findflags = #449;
 entity(.float fld, float match) findchainflags = #450;
-float(entity ent, string tagname) gettagindex = #451;
+int(entity ent, string tagname) gettagindex = #451;
 vector(entity ent, float tagindex) gettaginfo = #452;
 
 void(vector org, vector vel, float howmany) te_flamejet = #457;
@@ -1017,7 +1017,7 @@ float GETTIME_CDTRACK = 4;
 //idea: Electro, SavageX, LordHavoc
 //darkplaces implementation: LordHavoc
 //builtin definitions:
-float(string s, string separator1, ...) tokenizebyseparator = #479;
+int(string s, string separator1, ...) tokenizebyseparator = #479;
 //description:
 //this function returns tokens separated by any of the supplied separator strings, example:
 //numnumbers = tokenizebyseparator("10.2.3.4", ".");
@@ -1028,9 +1028,9 @@ float(string s, string separator1, ...) tokenizebyseparator = #479;
 //idea: divVerent
 //darkplaces implementation: divVerent
 //builtin definitions:
-float(string s) tokenize_console = #514;
-float(float i) argv_start_index = #515;
-float(float i) argv_end_index = #516;
+int(string s) tokenize_console = #514;
+int(float i) argv_start_index = #515;
+int(float i) argv_end_index = #516;
 //description:
 //this function returns tokens separated just like the console does
 //also, functions are provided to get the index of the first and last character of each token in the original string
@@ -1229,10 +1229,10 @@ float(float modlindex, string framename) frameforname = #276; // finds number of
 float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
 //fields:
 .float skeletonindex; // active skeleton overriding standard animation on model
-.float frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
-.float frame2; // secondary framegroup animation (strength = lerpfrac)
-.float frame3; // tertiary framegroup animation (strength = lerpfrac3)
-.float frame4; // quaternary framegroup animation (strength = lerpfrac4)
+.int frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
+.int frame2; // secondary framegroup animation (strength = lerpfrac)
+.int frame3; // tertiary framegroup animation (strength = lerpfrac3)
+.int frame4; // quaternary framegroup animation (strength = lerpfrac4)
 .float lerpfrac; // strength of framegroup blend
 .float lerpfrac3; // strength of framegroup blend
 .float lerpfrac4; // strength of framegroup blend
@@ -1416,12 +1416,12 @@ float(string s) isfunction = #607;
 void(entity e, string s) parseentitydata = #608;
 
 // assorted builtins
-const float            STAT_MOVEVARS_TICRATE           = 240;
-const float            STAT_MOVEVARS_TIMESCALE         = 241;
-const float            STAT_FRAGLIMIT                                  = 235;
-const float            STAT_TIMELIMIT                                  = 236;
-const float     STAT_MOVEVARS_GRAVITY           = 242;
-string(void)                                           ReadPicture = #501;
+const int STAT_MOVEVARS_TICRATE        = 240;
+const int STAT_MOVEVARS_TIMESCALE      = 241;
+const int STAT_FRAGLIMIT                               = 235;
+const int STAT_TIMELIMIT                               = 236;
+const int STAT_MOVEVARS_GRAVITY        = 242;
+string(void) ReadPicture                               = #501;
 const int PARTICLES_USEALPHA = 1;
 float particles_alphamin, particles_alphamax;
 const int PARTICLES_USECOLOR = 2;
index 6696d7c3adc0f02a97c3231ca50cb3b4dcfb7606..a38746e5959a5bb4fcb9bd67d444ea9f36ddd60b 100644 (file)
@@ -2137,8 +2137,8 @@ float(float modlindex) skel_create = #263; // create a skeleton (be sure to assi
 float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
 float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
 string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
-float(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
-float(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
+int(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
+int(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
 vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
 vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
 void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)