From: TimePath Date: Thu, 29 Jan 2015 07:41:08 +0000 (+1100) Subject: Declare more ints as ints X-Git-Tag: xonotic-v0.8.1~133^2~14 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bb9450d7c9e2d77e39d5cfcce7a0a74b76de3cf5;p=xonotic%2Fxonotic-data.pk3dir.git Declare more ints as ints --- diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index d139f589c..dde446182 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -16,7 +16,7 @@ #include "../warpzonelib/mathlib.qh" .float death_time; - .float modelflags; + .int modelflags; #elif defined(MENUQC) #elif defined(SVQC) #endif diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index e97c89e09..73eb6f193 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -400,10 +400,9 @@ void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theA // Weapon icons (#0) // entity weaponorder[WEP_MAXCOUNT]; -void weaponorder_swap(float i, float j, entity pass) +void weaponorder_swap(int i, int j, entity pass) { - entity h; - h = weaponorder[i]; + entity h = weaponorder[i]; weaponorder[i] = weaponorder[j]; weaponorder[j] = h; } @@ -468,7 +467,7 @@ void HUD_Weapons(void) // figure out weapon order (how the weapons are sorted) // TODO make this configurable if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0]) { - float weapon_cnt; + int weapon_cnt; if(weaponorder_bypriority) strunzone(weaponorder_bypriority); if(weaponorder_byimpulse) diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index d2b225765..7da989492 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -349,8 +349,8 @@ HUD_PANELS(HUD_PANEL) HUD_Panel_GetBorder(); \ } while(0) -const float NOTIFY_MAX_ENTRIES = 10; -const float NOTIFY_ICON_MARGIN = 0.02; +const int NOTIFY_MAX_ENTRIES = 10; +const int NOTIFY_ICON_MARGIN = 0.02; int notify_index; int notify_count; diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index e468514d9..093c96575 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -504,7 +504,8 @@ float hud_field_icon1_alpha; float hud_field_icon2_alpha; string HUD_GetField(entity pl, int field) { - float tmp, num, denom, f; + float tmp, num, denom; + int f; string str; hud_field_rgb = '1 1 1'; hud_field_icon0 = ""; @@ -682,7 +683,7 @@ void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_s vector tmp, rgb; rgb = Team_ColorRGB(pl.team); string str; - float field; + int field; float is_spec; is_spec = (GetPlayerColor(pl.sv_entnum) == NUM_SPECTATOR); @@ -969,7 +970,7 @@ float average_accuracy; vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size) { int i; - float weapon_cnt = WEP_COUNT - 3; // either vaporizer/vortex are hidden, no port-o-launch, no tuba + int weapon_cnt = WEP_COUNT - 3; // either vaporizer/vortex are hidden, no port-o-launch, no tuba float rows; if(autocvar_scoreboard_accuracy_doublerows) rows = 2; diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 235756ced..ef61bb0cb 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -87,7 +87,7 @@ void Draw_ShowNames(entity ent) if(autocvar_hud_shownames_crosshairdistance > crosshairdistance) ent.pointtime = time; - if (!(ent.pointtime + autocvar_hud_shownames_crosshairdistance_time > time)) + if (ent.pointtime + autocvar_hud_shownames_crosshairdistance_time <= time) overlap = true; else overlap = (autocvar_hud_shownames_crosshairdistance_antioverlap ? overlap : false); // override what antioverlap says unless allowed by cvar. diff --git a/qcsrc/client/target_music.qc b/qcsrc/client/target_music.qc index 6006aeb47..662a673d7 100644 --- a/qcsrc/client/target_music.qc +++ b/qcsrc/client/target_music.qc @@ -53,17 +53,14 @@ void TargetMusic_Advance() void Net_TargetMusic() { - float vol, fai, fao, tim, id; - string noi; - entity e; - - id = ReadShort(); - vol = ReadByte() / 255.0; - fai = ReadByte() / 16.0; - fao = ReadByte() / 16.0; - tim = ReadByte(); - noi = ReadString(); + int id = ReadShort(); + float vol = ReadByte() / 255.0; + float fai = ReadByte() / 16.0; + float fao = ReadByte() / 16.0; + float tim = ReadByte(); + string noi = ReadString(); + entity e; for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); ) { if(e.count == id) diff --git a/qcsrc/client/tturrets.qc b/qcsrc/client/tturrets.qc index 9dbecd384..50a39b684 100644 --- a/qcsrc/client/tturrets.qc +++ b/qcsrc/client/tturrets.qc @@ -668,8 +668,7 @@ void ent_turret() if(sf & TNSF_STATUS) { - float _tmp; - _tmp = ReadByte(); + int _tmp = ReadByte(); if(_tmp != self.team) { self.team = _tmp; diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 5c7181a1c..4330ecbdc 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -986,8 +986,8 @@ void UpdateCrosshair() } } -const float BUTTON_3 = 4; -const float BUTTON_4 = 8; +const int BUTTON_3 = 4; +const int BUTTON_4 = 8; float cl_notice_run(); float prev_myteam; void CSQC_UpdateView(float w, float h) diff --git a/qcsrc/common/animdecide.qc b/qcsrc/common/animdecide.qc index f122ca2de..c457d5ca7 100644 --- a/qcsrc/common/animdecide.qc +++ b/qcsrc/common/animdecide.qc @@ -313,7 +313,7 @@ void animdecide_setframes(entity e, float support_blending, .float fld_frame, .f } } -void animdecide_setstate(entity e, float newstate, float restart) +void animdecide_setstate(entity e, int newstate, float restart) { if(!restart) if(newstate == e.anim_state) diff --git a/qcsrc/common/animdecide.qh b/qcsrc/common/animdecide.qh index c4834793a..885a11608 100644 --- a/qcsrc/common/animdecide.qh +++ b/qcsrc/common/animdecide.qh @@ -25,7 +25,7 @@ void animdecide_setframes(entity e, bool support_blending, .int fld_frame, .int .float anim_upper_implicit_time; // explicit anim states (networked) -void animdecide_setstate(entity e, float newstate, float restart); +void animdecide_setstate(entity e, int newstate, float restart); 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. diff --git a/qcsrc/common/buffs.qc b/qcsrc/common/buffs.qc index 18fbd0f88..cbb40d13d 100644 --- a/qcsrc/common/buffs.qc +++ b/qcsrc/common/buffs.qc @@ -9,7 +9,7 @@ #include "buffs.qh" #endif -vector Buff_Color(float buff_id) +vector Buff_Color(int buff_id) { entity e; for(e = Buff_Type_first; e; e = e.enemy) @@ -18,7 +18,7 @@ vector Buff_Color(float buff_id) return '1 1 1'; } -string Buff_PrettyName(float buff_id) +string Buff_PrettyName(int buff_id) { entity e; for(e = Buff_Type_first; e; e = e.enemy) @@ -27,7 +27,7 @@ string Buff_PrettyName(float buff_id) return ""; } -string Buff_Name(float buff_id) +string Buff_Name(int buff_id) { entity e; for(e = Buff_Type_first; e; e = e.enemy) @@ -36,7 +36,7 @@ string Buff_Name(float buff_id) return ""; } -float Buff_Type_FromName(string buff_name) +int Buff_Type_FromName(string buff_name) { entity e; for(e = Buff_Type_first; e; e = e.enemy) @@ -45,7 +45,7 @@ float Buff_Type_FromName(string buff_name) return 0; } -float Buff_Type_FromSprite(string buff_sprite) +int Buff_Type_FromSprite(string buff_sprite) { entity e; for(e = Buff_Type_first; e; e = e.enemy) @@ -55,7 +55,7 @@ float Buff_Type_FromSprite(string buff_sprite) } -float Buff_Skin(float buff_id) +int Buff_Skin(float buff_id) { entity e; for(e = Buff_Type_first; e; e = e.enemy) @@ -64,7 +64,7 @@ float Buff_Skin(float buff_id) return 0; } -string Buff_Sprite(float buff_id) +string Buff_Sprite(int buff_id) { entity e; for(e = Buff_Type_first; e; e = e.enemy) diff --git a/qcsrc/common/buffs.qh b/qcsrc/common/buffs.qh index e2dcbae2c..a36ae3f6c 100644 --- a/qcsrc/common/buffs.qh +++ b/qcsrc/common/buffs.qh @@ -5,17 +5,17 @@ entity Buff_Type_first; entity Buff_Type_last; .entity enemy; // internal next pointer -float BUFF_LAST = 1; +int BUFF_LAST = 1; .int items; // buff ID .string netname; // buff name .string message; // human readable name .vector colormod; // buff color .string model2; // buff sprite -.float skin; // buff skin +.int skin; // buff skin #define REGISTER_BUFF(hname,sname,NAME,bskin,bcolor) \ - float BUFF_##NAME; \ + int BUFF_##NAME; \ entity Buff_Type##sname; \ void RegisterBuffs_##sname() \ { \ @@ -50,9 +50,9 @@ REGISTER_BUFF(_("Invisible"),invisible,INVISIBLE,12,'0.9 0.9 0.9'); #undef REGISTER_BUFF #ifdef SVQC -.float buffs; +.int buffs; void buff_Init(entity ent); -void buff_Init_Compat(entity ent, float replacement); +void buff_Init_Compat(entity ent, int replacement); #define BUFF_SPAWNFUNC(e,b,t) void spawnfunc_item_buff_##e() { self.buffs = b; self.team = t; buff_Init(self); } #define BUFF_SPAWNFUNC_Q3TA_COMPAT(o,r) void spawnfunc_item_##o() { buff_Init_Compat(self,r); } @@ -87,11 +87,11 @@ BUFF_SPAWNFUNC_Q3TA_COMPAT(invis, BUFF_INVISIBLE) BUFF_SPAWNFUNC_Q3TA_COMPAT(medic, BUFF_MEDIC) #endif -vector Buff_Color(float buff_id); -string Buff_PrettyName(float buff_id); -string Buff_Name(float buff_id); -float Buff_Type_FromName(string buff_name); -float Buff_Type_FromSprite(string buff_sprite); -float Buff_Skin(float buff_id); -string Buff_Sprite(float buff_id); +vector Buff_Color(int buff_id); +string Buff_PrettyName(int buff_id); +string Buff_Name(int buff_id); +int Buff_Type_FromName(string buff_name); +int Buff_Type_FromSprite(string buff_sprite); +int Buff_Skin(int buff_id); +string Buff_Sprite(int buff_id); #endif \ No newline at end of file diff --git a/qcsrc/common/campaign_common.qh b/qcsrc/common/campaign_common.qh index 01dbeb919..21af40149 100644 --- a/qcsrc/common/campaign_common.qh +++ b/qcsrc/common/campaign_common.qh @@ -6,8 +6,8 @@ #endif // each i-th array element corresponds to the list entry campaign_offset+i -float campaign_entries; -float campaign_offset; +int campaign_entries; +int campaign_offset; string campaign_gametype[CAMPAIGN_MAX_ENTRIES]; string campaign_mapname[CAMPAIGN_MAX_ENTRIES]; float campaign_bots[CAMPAIGN_MAX_ENTRIES]; diff --git a/qcsrc/common/campaign_file.qc b/qcsrc/common/campaign_file.qc index f1622bda5..27319ec7c 100644 --- a/qcsrc/common/campaign_file.qc +++ b/qcsrc/common/campaign_file.qc @@ -87,10 +87,10 @@ float CampaignFile_Load(float offset, float n) void CampaignFile_Unload() { - float i; if(campaign_title) { strunzone(campaign_title); + int i; for(i = 0; i < campaign_entries; ++i) { strunzone(campaign_gametype[i]); diff --git a/qcsrc/common/campaign_setup.qc b/qcsrc/common/campaign_setup.qc index 981174f0a..b822c3494 100644 --- a/qcsrc/common/campaign_setup.qc +++ b/qcsrc/common/campaign_setup.qc @@ -6,7 +6,7 @@ #include "mapinfo.qh" #endif -void CampaignSetup(float n) +void CampaignSetup(int n) { localcmd("set g_campaign 1\n"); localcmd("set _campaign_name \""); diff --git a/qcsrc/common/deathtypes.qh b/qcsrc/common/deathtypes.qh index 0e6336af6..0bf387389 100644 --- a/qcsrc/common/deathtypes.qh +++ b/qcsrc/common/deathtypes.qh @@ -118,7 +118,7 @@ DEATHTYPES #define DEATH_WEAPONOF(t) (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t)) #define WEP_VALID(w) ((w) >= WEP_FIRST && (w) <= WEP_LAST) -string Deathtype_Name(float deathtype) +string Deathtype_Name(int deathtype) { if(DEATH_ISSPECIAL(deathtype)) { diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 90095b1fe..914e1dee5 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -17,9 +17,9 @@ // generic string stuff -float _MapInfo_Cache_Active; -float _MapInfo_Cache_DB_NameToIndex; -float _MapInfo_Cache_Buf_IndexToMapData; +int _MapInfo_Cache_Active; +int _MapInfo_Cache_DB_NameToIndex; +int _MapInfo_Cache_Buf_IndexToMapData; void MapInfo_Cache_Destroy() { @@ -1247,7 +1247,7 @@ string MapInfo_FixName(string s) return MapInfo_FindName_match; } -float MapInfo_CurrentFeatures() +int MapInfo_CurrentFeatures() { 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"))) @@ -1255,7 +1255,7 @@ float MapInfo_CurrentFeatures() return req; } -float MapInfo_CurrentGametype() +int MapInfo_CurrentGametype() { entity e; int prev = cvar("gamecfg"); diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 943e81fee..03ad44870 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -1,12 +1,12 @@ #ifndef MAPINFO_H #define MAPINFO_H -float MAPINFO_TYPE_ALL; +int MAPINFO_TYPE_ALL; entity MapInfo_Type_first; entity MapInfo_Type_last; .entity enemy; // internal next pointer -.float items; // game type ID +.int items; // game type ID .string netname; // game type name as in cvar (with g_ prefix) .string mdl; // game type short name .string message; // human readable name diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 74f3816f4..29209172c 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -283,7 +283,7 @@ float LoadMonsterSounds(string f, float first) return 1; } -.float skin_for_monstersound; +.int skin_for_monstersound; void UpdateMonsterSounds() { entity mon = get_monsterinfo(self.monsterid); diff --git a/qcsrc/common/nades.qc b/qcsrc/common/nades.qc index 12a86eedd..28a88b6e4 100644 --- a/qcsrc/common/nades.qc +++ b/qcsrc/common/nades.qc @@ -16,7 +16,7 @@ #ifdef SVQC -float healer_send(entity to, float sf) +float healer_send(entity to, int sf) { WriteByte(MSG_ENTITY, ENT_CLIENT_HEALING_ORB); WriteByte(MSG_ENTITY, sf); diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index 24e20aa75..05c35c744 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -496,8 +496,8 @@ void Create_Notification_Entity( int typeId, int nameid, string namestring, - float strnum, - float flnum, + int strnum, + int flnum, /* MSG_ANNCE */ float channel, string snd, @@ -1376,7 +1376,7 @@ void Local_Notification_HUD_Notify_Push( void Local_Notification_centerprint_generic( string input, string durcnt, - float cpid, float f1, float f2) + int cpid, float f1, float f2) { string selected; float sel_num; @@ -1425,7 +1425,7 @@ void Local_Notification_centerprint_generic( } #endif -void Local_Notification(float net_type, float net_name, ...count) +void Local_Notification(int net_type, int net_name, ...count) { // check if this should be aborted if(net_name == NOTIF_ABORT) diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 60080b187..45d04f44d 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -54,8 +54,8 @@ void Create_Notification_Entity( float typeId, float nameid, string namestring, - float strnum, - float flnum, + int strnum, + int flnum, /* MSG_ANNCE */ float channel, string snd, @@ -86,7 +86,7 @@ void Dump_Notifications(float fh, float alsoprint); void Debug_Notification(string input); #endif -void Local_Notification(float net_type, float net_name, ...count); +void Local_Notification(int net_type, int net_name, ...count); void Local_Notification_WOVA( float net_type, float net_name, float stringcount, float floatcount, @@ -1508,7 +1508,7 @@ float notif_global_error; #define MSG_MULTI_NOTIF(default,name,anncename,infoname,centername) \ NOTIF_ADD_AUTOCVAR(name, default) \ - float name; \ + int name; \ void RegisterNotification_##name() \ { \ SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_MULTI_COUNT) \ diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index b885807fa..4a4f63686 100644 --- a/qcsrc/common/playerstats.qc +++ b/qcsrc/common/playerstats.qc @@ -109,12 +109,11 @@ float PlayerStats_GameReport_Event(string prefix, string event_id, float value) void PlayerStats_GameReport_Accuracy(entity p) { - entity w; - float i; + int i; for(i = WEP_FIRST; i <= WEP_LAST; ++i) { - w = get_weaponinfo(i); + entity w = get_weaponinfo(i); #define ACCMAC(suffix,field) \ PS_GR_P_ADDVAL(p, sprintf("acc-%s-%s", w.netname, suffix), p.accuracy.(field[i-1])); diff --git a/qcsrc/common/playerstats.qh b/qcsrc/common/playerstats.qh index 50a1409c0..e7a187e86 100644 --- a/qcsrc/common/playerstats.qh +++ b/qcsrc/common/playerstats.qh @@ -3,13 +3,13 @@ #ifdef SVQC //float PS_PM_IN_DB = -1; // playerstats_prematch_in_db // db for info COLLECTED at the beginning of a match -float PS_GR_OUT_DB = -1; // playerstats_gamereport_out_db // db of info SENT at the end of a match +int PS_GR_OUT_DB = -1; // playerstats_gamereport_out_db // db of info SENT at the end of a match //float PS_GR_IN_DB = -1; // playerstats_gamereport_in_db // db for info COLLECTED at the end of a match -float PS_B_IN_DB = -1; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (ELO) +int PS_B_IN_DB = -1; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (ELO) #endif #ifdef MENUQC -float PS_D_IN_DB = -1; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display +int PS_D_IN_DB = -1; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display #endif #ifdef SVQC diff --git a/qcsrc/common/urllib.qc b/qcsrc/common/urllib.qc index 417612231..8529ebd6d 100644 --- a/qcsrc/common/urllib.qc +++ b/qcsrc/common/urllib.qc @@ -28,13 +28,13 @@ const float URL_FH_STDOUT = -2; .entity url_ready_pass; // for multi handles -.float url_attempt; -.float url_mode; +.int url_attempt; +.int url_mode; entity url_fromid[NUM_URL_ID]; -float autocvar__urllib_nextslot; +int autocvar__urllib_nextslot; -float url_URI_Get_Callback(float id, float status, string data) +float url_URI_Get_Callback(int id, float status, string data) { if(id < MIN_URL_ID) return 0; @@ -96,7 +96,7 @@ float url_URI_Get_Callback(float id, float status, string data) } } -void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass) +void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass) { entity e; int i; @@ -377,7 +377,7 @@ void url_multi_ready(entity fh, entity me, float status) } me.url_ready(fh, me.url_ready_pass, status); } -void url_multi_fopen(string url, float mode, url_ready_func rdy, entity pass) +void url_multi_fopen(string url, int mode, url_ready_func rdy, entity pass) { float n; n = tokenize_console(url); diff --git a/qcsrc/common/urllib.qh b/qcsrc/common/urllib.qh index 8bc9e8333..87dcf8dde 100644 --- a/qcsrc/common/urllib.qh +++ b/qcsrc/common/urllib.qh @@ -14,7 +14,7 @@ string url_fgets(entity e); void url_fputs(entity e, string s); // returns true if handled -float url_URI_Get_Callback(float id, float status, string data); +float url_URI_Get_Callback(int id, float status, string data); #define MIN_URL_ID URI_GET_URLLIB #define NUM_URL_ID (URI_GET_URLLIB_END - URI_GET_URLLIB + 1) diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 686fd3bca..5d9997aaa 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -303,7 +303,7 @@ int db_create() return buf_create(); } -float db_load(string pFilename) +int db_load(string pFilename) { float db, fh, i, j, n; string l; @@ -395,7 +395,7 @@ void db_test() } // Multiline text file buffers -float buf_load(string pFilename) +int buf_load(string pFilename) { float buf, fh, i; string l; @@ -1908,8 +1908,7 @@ string getcurrentmod() #ifdef CSQC int ReadInt24_t() { - float v; - v = ReadShort() * 256; // note: this is signed + int v = ReadShort() * 256; // note: this is signed v += ReadByte(); // note: this is unsigned return v; } @@ -2363,8 +2362,7 @@ float InterpretBoolean(string input) #ifdef CSQC entity ReadCSQCEntity() { - float f; - f = ReadShort(); + int f = ReadShort(); if(f == 0) return world; return findfloat(world, entnum, f); diff --git a/qcsrc/common/weapons/config.qc b/qcsrc/common/weapons/config.qc index ed0dc2b93..885923e5f 100644 --- a/qcsrc/common/weapons/config.qc +++ b/qcsrc/common/weapons/config.qc @@ -12,21 +12,21 @@ // Balance Config Generator // ========================== -void W_Config_Queue_Swap(float root, float child, entity pass) +void W_Config_Queue_Swap(int root, int child, entity pass) { string oldroot = wep_config_queue[root]; wep_config_queue[root] = wep_config_queue[child]; wep_config_queue[child] = oldroot; } -float W_Config_Queue_Compare(float root, float child, entity pass) +float W_Config_Queue_Compare(int root, int child, entity pass) { return strcmp(wep_config_queue[root], wep_config_queue[child]); } void Dump_Weapon_Settings(void) { - float i, x, totalsettings = 0; + int i, x, totalsettings = 0; for(i = WEP_FIRST; i <= WEP_LAST; ++i) { // step 1: clear the queue diff --git a/qcsrc/common/weapons/weapons.qc b/qcsrc/common/weapons/weapons.qc index 627b1fd48..7b107607d 100644 --- a/qcsrc/common/weapons/weapons.qc +++ b/qcsrc/common/weapons/weapons.qc @@ -344,7 +344,7 @@ string GetAmmoPicture(.float ammotype) } #ifdef CSQC -.float GetAmmoFieldFromNum(float i) +.float GetAmmoFieldFromNum(int i) { switch(i) { @@ -358,7 +358,7 @@ string GetAmmoPicture(.float ammotype) } } -float GetAmmoStat(.float ammotype) +int GetAmmoStat(.float ammotype) { switch(ammotype) { diff --git a/qcsrc/common/weapons/weapons.qh b/qcsrc/common/weapons/weapons.qh index 1b2b7f7ea..3868ac3e8 100644 --- a/qcsrc/common/weapons/weapons.qh +++ b/qcsrc/common/weapons/weapons.qh @@ -79,8 +79,8 @@ void W_RandomWeapons(entity e, float n); string GetAmmoPicture(.float ammotype); #ifdef CSQC -.float GetAmmoFieldFromNum(float i); -float GetAmmoStat(.float ammotype); +.float GetAmmoFieldFromNum(int i); +int GetAmmoStat(.float ammotype); #endif // ammo types @@ -155,12 +155,12 @@ void register_weapons_done(); // entity properties of weaponinfo: // fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A" -.float weapon; // M: WEP_id // WEP_... +.int weapon; // M: WEP_id // WEP_... .WepSet weapons; // A: WEPSET_id // WEPSET_... .float(float) weapon_func; // M: function // w_... ..float ammo_field; // M: ammotype // main ammo field .int impulse; // M: impulse // weapon impulse -.float spawnflags; // M: flags // WEPSPAWNFLAG_... combined +.int spawnflags; // M: flags // WEPSPAWNFLAG_... combined .float bot_pickupbasevalue; // M: rating // bot weapon priority .vector wpcolor; // M: color // waypointsprite color .string wpmodel; // A: wpn-id // wpn- sprite name @@ -176,7 +176,7 @@ void register_weapons_done(); // note: the fabs call is just there to hide "if result is constant" warning #define REGISTER_WEAPON_2(id,bit,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) \ - float id; \ + int id; \ WepSet bit; \ float function(float); \ void RegisterWeapons_##id() \ diff --git a/qcsrc/csqcmodellib/cl_model.qc b/qcsrc/csqcmodellib/cl_model.qc index 2139b53e8..6d3542bd0 100644 --- a/qcsrc/csqcmodellib/cl_model.qc +++ b/qcsrc/csqcmodellib/cl_model.qc @@ -213,7 +213,7 @@ void CSQCModel_Draw() self.csqcmodel_teleported = 0; } -void CSQCModel_Read(float isnew) +void CSQCModel_Read(bool isnew) { int sf = ReadInt24_t(); diff --git a/qcsrc/csqcmodellib/cl_model.qh b/qcsrc/csqcmodellib/cl_model.qh index 68547e1b3..c527cc1f2 100644 --- a/qcsrc/csqcmodellib/cl_model.qh +++ b/qcsrc/csqcmodellib/cl_model.qh @@ -24,7 +24,7 @@ #include "common.qh" -void CSQCModel_Read(float isnew); +void CSQCModel_Read(bool isnew); #define CSQCMODEL_IF(cond) #define CSQCMODEL_ENDIF diff --git a/qcsrc/csqcmodellib/cl_player.qc b/qcsrc/csqcmodellib/cl_player.qc index 69793c2a8..1f3017afd 100644 --- a/qcsrc/csqcmodellib/cl_player.qc +++ b/qcsrc/csqcmodellib/cl_player.qc @@ -40,7 +40,8 @@ float autocvar_cl_movement_errorcompensation = 0; float pmove_onground; // weird engine flag we shouldn't really use but have to for now vector csqcplayer_origin, csqcplayer_velocity; -float csqcplayer_sequence, player_pmflags; +float csqcplayer_sequence; +int player_pmflags; float csqcplayer_moveframe; vector csqcplayer_predictionerroro; vector csqcplayer_predictionerrorv; diff --git a/qcsrc/csqcmodellib/sv_model.qc b/qcsrc/csqcmodellib/sv_model.qc index 55ca2ba5f..425c985ad 100644 --- a/qcsrc/csqcmodellib/sv_model.qc +++ b/qcsrc/csqcmodellib/sv_model.qc @@ -36,7 +36,7 @@ // generic CSQC model code -float CSQCModel_Send(entity to, float sf) +float CSQCModel_Send(entity to, int sf) { // some nice flags for CSQCMODEL_IF float isplayer = (IS_CLIENT(self)); diff --git a/qcsrc/dpdefs/csprogsdefs.qh b/qcsrc/dpdefs/csprogsdefs.qh index dac4c1651..ad71a02eb 100644 --- a/qcsrc/dpdefs/csprogsdefs.qh +++ b/qcsrc/dpdefs/csprogsdefs.qh @@ -437,17 +437,17 @@ void(string s) strunzone = #119; float(float number, float quantity) bitshift = #218; //float(string str, string sub[, float startpos]) strstrofs = #221; -float(string str, string sub, float startpos) strstrofs = #221; -float(string str, float ofs) str2chr = #222; -string(float c, ...) chr2str = #223; +int(string str, string sub, float startpos) strstrofs = #221; +int(string str, float ofs) str2chr = #222; +string(int c, ...) chr2str = #223; string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; string(float chars, string s, ...) strpad = #225; string(string info, string key, string value, ...) infoadd = #226; string(string info, string key) infoget = #227; -float(string s1, string s2) strcmp = #228; -float(string s1, string s2, float len) strncmp = #228; -float(string s1, string s2) strcasecmp = #229; -float(string s1, string s2, float len) strncasecmp = #230; +int(string s1, string s2) strcmp = #228; +int(string s1, string s2, float len) strncmp = #228; +int(string s1, string s2) strcasecmp = #229; +int(string s1, string s2, float len) strncasecmp = #230; // CSQC range #300-#399 void() clearscene = #300; @@ -1218,8 +1218,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) diff --git a/qcsrc/dpdefs/dpextensions.qh b/qcsrc/dpdefs/dpextensions.qh index 443d3248b..7a7c3cb0f 100644 --- a/qcsrc/dpdefs/dpextensions.qh +++ b/qcsrc/dpdefs/dpextensions.qh @@ -94,7 +94,7 @@ float(string s) checkextension = #99; //idea: LordHavoc //darkplaces implementation: LordHavoc //effects bit: -float EF_ADDITIVE = 32; +const int EF_ADDITIVE = 32; //description: //additive blending when this object is rendered @@ -102,7 +102,7 @@ float EF_ADDITIVE = 32; //idea: id Software //darkplaces implementation: LordHavoc //effects bit: -float EF_BLUE = 64; +const int EF_BLUE = 64; //description: //entity emits blue light (used for quad) @@ -110,7 +110,7 @@ float EF_BLUE = 64; //idea: LordHavoc //darkplaces implementation: [515] and LordHavoc //effects bit: -float EF_DOUBLESIDED = 32768; +const int EF_DOUBLESIDED = 32768; //description: //render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff. @@ -118,7 +118,7 @@ float EF_DOUBLESIDED = 32768; //idea: C.Brutail, divVerent, maikmerten //darkplaces implementation: divVerent //effects bit: -float EF_DYNAMICMODELLIGHT = 131072; +const int EF_DYNAMICMODELLIGHT = 131072; //description: //force dynamic model light on the entity, even if it's a BSP model (or anything else with lightmaps or light colors) @@ -126,7 +126,7 @@ float EF_DYNAMICMODELLIGHT = 131072; //idea: LordHavoc //darkplaces implementation: LordHavoc //effects bit: -float EF_FLAME = 1024; +const int EF_FLAME = 1024; //description: //entity is on fire @@ -134,7 +134,7 @@ float EF_FLAME = 1024; //idea: LordHavoc //darkplaces implementation: LordHavoc //effects bit: -float EF_FULLBRIGHT = 512; +const int EF_FULLBRIGHT = 512; //description: //entity is always brightly lit @@ -142,7 +142,7 @@ float EF_FULLBRIGHT = 512; //idea: Supa //darkplaces implementation: LordHavoc //effects bit: -float EF_NODEPTHTEST = 8192; +const int EF_NODEPTHTEST = 8192; //description: //makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost @@ -150,7 +150,7 @@ float EF_NODEPTHTEST = 8192; //idea: id Software //darkplaces implementation: LordHavoc //effects bit: -float EF_NODRAW = 16; +const int EF_NODRAW = 16; //description: //prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things) @@ -158,7 +158,7 @@ float EF_NODRAW = 16; //idea: Chris Page, Dresk //darkplaces implementation: LordHAvoc //effects bit: -float EF_NOGUNBOB = 256; +const int EF_NOGUNBOB = 256; //description: //this has different meanings depending on the entity it is used on: //player entity - prevents gun bobbing on player.viewmodel @@ -172,7 +172,7 @@ float EF_NOGUNBOB = 256; //idea: LordHavoc //darkplaces implementation: LordHavoc //effects bit: -float EF_NOSHADOW = 4096; +const int EF_NOSHADOW = 4096; //description: //realtime lights will not cast shadows from this entity (but can still illuminate it) @@ -180,7 +180,7 @@ float EF_NOSHADOW = 4096; //idea: id Software //darkplaces implementation: LordHavoc //effects bit: -float EF_RED = 128; +const int EF_RED = 128; //description: //entity emits red light (used for invulnerability) @@ -188,7 +188,7 @@ float EF_RED = 128; //idea: id software //darkplaces implementation: divVerent //effects bit: -float EF_RESTARTANIM_BIT = 1048576; +const int EF_RESTARTANIM_BIT = 1048576; //description: //when toggled, the current animation is restarted. Useful for weapon animation. //to toggle this bit in QC, you can do: @@ -198,7 +198,7 @@ float EF_RESTARTANIM_BIT = 1048576; //idea: MythWorks Inc //darkplaces implementation: LordHavoc //effects bit: -float EF_STARDUST = 2048; +const int EF_STARDUST = 2048; //description: //entity emits bouncing sparkles in every direction @@ -206,7 +206,7 @@ float EF_STARDUST = 2048; //idea: id software //darkplaces implementation: divVerent //effects bit: -float EF_TELEPORT_BIT = 2097152; +const int EF_TELEPORT_BIT = 2097152; //description: //when toggled, interpolation of the entity is skipped for one frame. Useful for teleporting. //to toggle this bit in QC, you can do: @@ -874,7 +874,7 @@ vector(entity e, float s, float n) getsurfacetriangle = #629; //idea: VorteX, LordHavoc //DarkPlaces implementation: VorteX //builtin definitions: -float(entity ent, string tagname) gettagindex = #451; +int(entity ent, string tagname) gettagindex = #451; vector(entity ent, float tagindex) gettaginfo = #452; //description: //gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index). @@ -1085,7 +1085,7 @@ string(string s) strtoupper = #481; // returns the passed in string in pure uppe //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", "."); @@ -1096,9 +1096,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 @@ -1577,7 +1577,7 @@ void(vector origin, string sample, float volume, float attenuation) pointsound = //idea: LordHavoc, Dresk //darkplaces implementation: LordHavoc //field definitions: -.float modelflags; +.int modelflags; //constant definitions: float EF_NOMODELFLAGS = 8388608; // ignore any effects in a model file and substitute your own float MF_ROCKET = 1; // leave a trail @@ -1638,7 +1638,7 @@ float MF_TRACER3 = 128; // purple trail //idea: Spike //darkplaces implementation: LordHavoc //function definitions: -float(string effectname) particleeffectnum = #335; // same as in CSQC +int(string effectname) particleeffectnum = #335; // same as in CSQC void(entity ent, float effectnum, vector start, vector end) trailparticles = #336; // same as in CSQC void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC //SVC definitions: @@ -2110,7 +2110,7 @@ float(string filename, float mode) fopen = #110; // opens a file inside quake/ga void(float fhandle) fclose = #111; // closes a file string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file -float(string s) strlen = #114; // returns how many characters are in a string +int(string s) strlen = #114; // returns how many characters are in a string string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring - see FTE_STRINGS for enhanced version vector(string s) stov = #117; // returns vector value from a string @@ -2311,7 +2311,7 @@ void() example_skel_player_delete = //void(string s) SV_ParseClientCommand; //builtin definitions: void(entity e, string s) clientcommand = #440; -float(string s) tokenize = #441; +int(string s) tokenize = #441; string(float n) argv = #442; //description: //provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it @@ -2377,7 +2377,7 @@ float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten) .float style; // light style (like normal light entities, flickering torches or switchable, etc) .float pflags; // flags (see PFLAGS_ constants) .vector angles; // orientation of the light -.float skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped +.int skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped //constants: float PFLAGS_NOSHADOW = 1; // light does not cast shadows float PFLAGS_CORONA = 2; // light has a corona flare @@ -2411,16 +2411,16 @@ float checkpvs(vector viewpos, entity viewee) = #240; //darkplaces implementation: KrimZon //builtin definitions: int(string str, string sub, float startpos) strstrofs = #221; // returns the offset into a string of the matching text, or -1 if not found, case sensitive -float(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character -string(float c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127. +int(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character +string(int c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127. string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; // reformat a string with special color characters in the font, DO NOT USE THIS ON UTF8 ENGINES (if you are lucky they will emit ^4 and such color codes instead), the parameter values are 0=same/1=lower/2=upper for ccase, 0=same/1=white/2=red/5=alternate/6=alternate-alternate for redalpha, 0=same/1=white/2=red/3=redspecial/4=whitespecial/5=alternate/6=alternate-alternate for rednum. string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and " string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found -float(string s1, string s2) strcmp = #228; // compare two strings -float(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character. -float(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar -float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp +int(string s1, string s2) strcmp = #228; // compare two strings +int(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character. +int(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar +int(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp //string(string s, float start, float length) substring = #116; // see note below //description: //various string manipulation functions diff --git a/qcsrc/dpdefs/menudefs.qh b/qcsrc/dpdefs/menudefs.qh index 99d88ba2c..7ef710106 100644 --- a/qcsrc/dpdefs/menudefs.qh +++ b/qcsrc/dpdefs/menudefs.qh @@ -385,17 +385,17 @@ vector gecko_get_texture_extent( string name ) = #493; //darkplaces implementation: KrimZon //description: //various string manipulation functions -float(string str, string sub, float startpos) strstrofs = #221; -float(string str, float ofs) str2chr = #222; -string(float c, ...) chr2str = #223; +int(string str, string sub, float startpos) strstrofs = #221; +int(string str, float ofs) str2chr = #222; +string(int c, ...) chr2str = #223; string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; string(float chars, string s, ...) strpad = #225; string(string info, string key, string value, ...) infoadd = #226; string(string info, string key) infoget = #227; -float(string s1, string s2) strcmp = #228; -float(string s1, string s2, float len) strncmp = #228; -float(string s1, string s2) strcasecmp = #229; -float(string s1, string s2, float len) strncasecmp = #230; +int(string s1, string s2) strcmp = #228; +int(string s1, string s2, float len) strncmp = #228; +int(string s1, string s2) strcasecmp = #229; +int(string s1, string s2, float len) strncasecmp = #230; //DP_PRECACHE_PIC_FLAGS //idea: divVerent diff --git a/qcsrc/dpdefs/progsdefs.qh b/qcsrc/dpdefs/progsdefs.qh index 0064060a4..de39d64a6 100644 --- a/qcsrc/dpdefs/progsdefs.qh +++ b/qcsrc/dpdefs/progsdefs.qh @@ -33,7 +33,7 @@ float deathmatch; float coop; float teamplay; -float serverflags; // propagated from level to level, used to +int serverflags; // propagated from level to level, used to // keep track of completed episodes float total_secrets; @@ -122,8 +122,8 @@ void end_sys_globals; // flag for structure dumping .string classname; // spawn function .string model; .float frame; -.float skin; -.float effects; +.int skin; +.int effects; .vector mins, maxs; // bounding box extents reletive to origin .vector size; // maxs - mins @@ -139,13 +139,13 @@ void end_sys_globals; // flag for structure dumping // stats .float health; .float frags; -.float weapon; // one of the IT_SHOTGUN, etc flags +.int weapon; // one of the IT_SHOTGUN, etc flags .string weaponmodel; .float weaponframe; .float currentammo; .float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; -.float items; // bit flags +.int items; // bit flags .float takedamage; .entity chain; @@ -169,9 +169,9 @@ void end_sys_globals; // flag for structure dumping .entity enemy; -.float flags; +.int flags; -.float colormap; +.int colormap; .float team; .float max_health; // players maximum health is stored here @@ -191,7 +191,7 @@ void end_sys_globals; // flag for structure dumping .entity goalentity; // a movetarget or an enemy -.float spawnflags; +.int spawnflags; .string target; .string targetname; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 8ba66f78d..bd5109fb3 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -118,7 +118,7 @@ void player_setupanimsformodel() void player_anim (void) { - float deadbits = (self.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2)); + int deadbits = (self.anim_state & (ANIMSTATE_DEAD1 | ANIMSTATE_DEAD2)); if(self.deadflag) { if (!deadbits) { // Decide on which death animation to use. @@ -131,7 +131,7 @@ void player_anim (void) // Clear a previous death animation. deadbits = 0; } - float animbits = deadbits; + int animbits = deadbits; if(self.frozen) animbits |= ANIMSTATE_FROZEN; if(self.crouch) diff --git a/qcsrc/server/cl_player.qh b/qcsrc/server/cl_player.qh index 6f2aceec3..4479f98c8 100644 --- a/qcsrc/server/cl_player.qh +++ b/qcsrc/server/cl_player.qh @@ -59,8 +59,8 @@ void ClearPlayerSounds(); float LoadPlayerSounds(string f, float first); -.float modelindex_for_playersound; -.float skin_for_playersound; +.int modelindex_for_playersound; +.int skin_for_playersound; void UpdatePlayerSounds(); void FakeGlobalSound(string sample, float chan, float voicetype); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index f8e8952f9..c49af0d8f 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -182,7 +182,7 @@ const float MAX_DAMAGEEXTRARADIUS = 16; .entity exteriorweaponentity; .vector weaponentity_glowmod; -//.float weapon; // current weapon +//.int weapon; // current weapon .float switchweapon; // weapon requested to switch to .float switchingweapon; // weapon currently being switched to (is copied from switchweapon once switch is possible) .string weaponname; // name of .weapon @@ -346,7 +346,7 @@ float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end) float next_pingtime; .float Version; -.float SendFlags; +.int SendFlags; .float(entity to, float sendflags) SendEntity; // player sounds, voice messages diff --git a/qcsrc/server/vehicles/bumblebee.qh b/qcsrc/server/vehicles/bumblebee.qh index 132f1f02d..18d90aa3b 100644 --- a/qcsrc/server/vehicles/bumblebee.qh +++ b/qcsrc/server/vehicles/bumblebee.qh @@ -1,9 +1,9 @@ #ifndef BUMBLEBEE_H #define BUMBLEBEE_H -const float BRG_SETUP = 2; -const float BRG_START = 4; -const float BRG_END = 8; +const int BRG_SETUP = 2; +const int BRG_START = 4; +const int BRG_END = 8; #ifdef SVQC // Auto cvars diff --git a/qcsrc/server/vehicles/vehicles_def.qh b/qcsrc/server/vehicles/vehicles_def.qh index 1e3cff4cd..6a55456ab 100644 --- a/qcsrc/server/vehicles/vehicles_def.qh +++ b/qcsrc/server/vehicles/vehicles_def.qh @@ -7,21 +7,21 @@ #define VEHICLES_ENABLED #ifdef VEHICLES_ENABLED -.float vehicle_flags; -const float VHF_ISVEHICLE = 2; /// Indicates vehicle -const float VHF_HASSHIELD = 4; /// Vehicle has shileding -const float VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates -const float VHF_HEALTHREGEN = 16; /// Vehicles health regenerates -const float VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates -const float VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage -const float VHF_MOVE_GROUND = 128; /// Vehicle moves on gound -const float VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound -const float VHF_MOVE_FLY = 512; /// Vehicle is airborn -const float VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50% -const float VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50% -const float VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50% -const float VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots -const float VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle +.int vehicle_flags; +const int VHF_ISVEHICLE = 2; /// Indicates vehicle +const int VHF_HASSHIELD = 4; /// Vehicle has shileding +const int VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates +const int VHF_HEALTHREGEN = 16; /// Vehicles health regenerates +const int VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates +const int VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage +const int VHF_MOVE_GROUND = 128; /// Vehicle moves on gound +const int VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound +const int VHF_MOVE_FLY = 512; /// Vehicle is airborn +const int VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50% +const int VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50% +const int VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50% +const int VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots +const int VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle .entity gun1; .entity gun2; diff --git a/qcsrc/warpzonelib/mathlib.qc b/qcsrc/warpzonelib/mathlib.qc index b45c22a21..8dd9684e5 100644 --- a/qcsrc/warpzonelib/mathlib.qc +++ b/qcsrc/warpzonelib/mathlib.qc @@ -18,25 +18,25 @@ int fpclassify(float x) return FP_ZERO; return FP_NORMAL; } -int isfinite(float x) +bool isfinite(float x) { return !(isnan(x) || isinf(x)); } -int isinf(float x) +bool isinf(float x) { return (x != 0) && (x + x == x); } -int isnan(float x) +bool isnan(float x) { float y; y = x; return (x != y); } -int isnormal(float x) +bool isnormal(float x) { return isfinite(x); } -int signbit(float x) +bool signbit(float x) { return (x < 0); } diff --git a/qcsrc/warpzonelib/mathlib.qh b/qcsrc/warpzonelib/mathlib.qh index 6d1e488dc..659f43776 100644 --- a/qcsrc/warpzonelib/mathlib.qh +++ b/qcsrc/warpzonelib/mathlib.qh @@ -6,17 +6,17 @@ // The commented-out functions need no implementation because DarkPlaces offers // them as builtins. They are listed here anyway for completeness sake. -const float FP_NAN = 0; -const float FP_INFINITE = 1; -const float FP_ZERO = 2; -const float FP_SUBNORMAL = 3; -const float FP_NORMAL = 4; +const int FP_NAN = 0; +const int FP_INFINITE = 1; +const int FP_ZERO = 2; +const int FP_SUBNORMAL = 3; +const int FP_NORMAL = 4; int fpclassify(float x); -int isfinite(float x); -int isinf(float x); -int isnan(float x); -int isnormal(float x); -int signbit(float x); +bool isfinite(float x); +bool isinf(float x); +bool isnan(float x); +bool isnormal(float x); +bool signbit(float x); //float acos(float x); //float asin(float x);