]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Client: Type check
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 22 Mar 2016 04:57:23 +0000 (15:57 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 22 Mar 2016 04:57:23 +0000 (15:57 +1100)
22 files changed:
qcsrc/client/commands/cl_cmd.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/hud/hud.qc
qcsrc/client/hud/hud_config.qc
qcsrc/client/hud/panel/ammo.qc
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/powerups.qc
qcsrc/client/hud/panel/radar.qc
qcsrc/client/hud/panel/weapons.qc
qcsrc/client/main.qc
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/player_skeleton.qc
qcsrc/client/quickmenu.qc
qcsrc/client/scoreboard.qc
qcsrc/client/teamradar.qc
qcsrc/client/view.qc
qcsrc/client/weapons/projectile.qc
qcsrc/common/mutators/base.qh
qcsrc/lib/_all.inc
qcsrc/server/_all.qh

index 5a1350f02f4b78fc2e1c9cb583fe4b856cf0485f..fdc7dae708d2a403dfc867c4f907850d3ee1c740 100644 (file)
@@ -41,6 +41,7 @@ void DrawDebugModel(entity this)
 
 void LocalCommand_blurtest(int request)
 {
+    TC(int, request);
        // Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
        // Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
 
@@ -76,6 +77,7 @@ void LocalCommand_blurtest(int request)
 
 void LocalCommand_boxparticles(int request, int argc)
 {
+    TC(int, request); TC(int, argc);
        switch (request)
        {
                case CMD_REQUEST_COMMAND:
@@ -129,6 +131,7 @@ void LocalCommand_boxparticles(int request, int argc)
 
 void LocalCommand_create_scrshot_ent(int request)
 {
+    TC(int, request);
        switch (request)
        {
                case CMD_REQUEST_COMMAND:
@@ -167,6 +170,7 @@ void LocalCommand_create_scrshot_ent(int request)
 
 void LocalCommand_debugmodel(int request, int argc)
 {
+    TC(int, request); TC(int, argc);
        switch (request)
        {
                case CMD_REQUEST_COMMAND:
@@ -195,6 +199,7 @@ void LocalCommand_debugmodel(int request, int argc)
 
 void LocalCommand_handlevote(int request, int argc)
 {
+    TC(int, request); TC(int, argc);
        switch (request)
        {
                case CMD_REQUEST_COMMAND:
@@ -254,6 +259,7 @@ void HUD_Radar_Show_Maximized(bool doshow, bool clickable);
 
 void LocalCommand_hud(int request, int argc)
 {
+    TC(int, request); TC(int, argc);
        switch (request)
        {
                case CMD_REQUEST_COMMAND:
@@ -346,6 +352,7 @@ void LocalCommand_hud(int request, int argc)
 
 void LocalCommand_localprint(int request, int argc)
 {
+    TC(int, request); TC(int, argc);
        switch (request)
        {
                case CMD_REQUEST_COMMAND:
@@ -372,6 +379,7 @@ void LocalCommand_localprint(int request, int argc)
 
 void LocalCommand_mv_download(int request, int argc)
 {
+    TC(int, request); TC(int, argc);
        switch (request)
        {
                case CMD_REQUEST_COMMAND:
@@ -398,6 +406,7 @@ void LocalCommand_mv_download(int request, int argc)
 
 void LocalCommand_sendcvar(int request, int argc)
 {
+    TC(int, request); TC(int, argc);
        switch (request)
        {
                case CMD_REQUEST_COMMAND:
index d0910e37456e0bc29e568e820535bfab4e661699..35f28bdca4dec5baea11b3a20dc3db4ca0a76322 100644 (file)
@@ -353,6 +353,7 @@ void CSQCPlayer_AnimDecide_PostUpdate(entity this, bool isnew)
 }
 int CSQCPlayer_FallbackFrame(entity this, int f)
 {
+    TC(int, f);
        if(frameduration(this.modelindex, f) > 0)
                return f; // goooooood
        if(frameduration(this.modelindex, 1) <= 0)
index a4e83183565324b5f2392a89b32ee5ba05d90f9d..f62b8992e14111773fb9f7c482b235246fcfa98b 100644 (file)
@@ -68,12 +68,14 @@ vector HUD_Get_Num_Color (float x, float maxvalue)
 
 float HUD_GetRowCount(int item_count, vector size, float item_aspect)
 {
+    TC(int, item_count);
        float aspect = size_y / size_x;
        return bound(1, floor((sqrt(4 * item_aspect * aspect * item_count + aspect * aspect) + aspect + 0.5) / 2), item_count);
 }
 
 vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect)
 {
+    TC(int, item_count);
        float columns, rows;
        float ratio, best_ratio = 0;
        float best_columns = 1, best_rows = 1;
@@ -115,6 +117,7 @@ vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspe
 // return the string of the onscreen race timer
 string MakeRaceString(int cp, float mytime, float theirtime, float lapdelta, string theirname)
 {
+    TC(int, cp);
        string col;
        string timestr;
        string cpname;
@@ -200,6 +203,7 @@ HUD panels
 //basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
 void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
 {
+    TC(bool, vertical); TC(int, drawflag);
        if(!length_ratio || !theAlpha)
                return;
        if(length_ratio > 1)
@@ -303,6 +307,7 @@ void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, flo
 
 void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag)
 {
+    TC(int, drawflag);
        if(!theAlpha)
                return;
 
@@ -320,6 +325,7 @@ void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theA
 
 void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha, float fadelerp)
 {
+    TC(bool, vertical); TC(bool, icon_right_align);
        vector newPos = '0 0 0', newSize = '0 0 0';
        vector picpos, numpos;
 
@@ -399,6 +405,7 @@ void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bo
 
 void DrawNumIcon(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha)
 {
+    TC(bool, vertical); TC(bool, icon_right_align);
        DrawNumIcon_expanding(myPos, mySize, x, icon, vertical, icon_right_align, color, theAlpha, 0);
 }
 
@@ -427,6 +434,7 @@ void HUD_Vehicle()
 
 bool HUD_Panel_CheckFlags(int showflags)
 {
+    TC(int, showflags);
        if ( HUD_Minigame_Showpanels() )
                return showflags & PANEL_SHOW_MINIGAME;
        if(intermission == 2)
index 2ba78f798a1e45816a03043bbcafe2251fc3efe5..8e69a2decde0d39e707e6fd2c093d4969214beb3 100644 (file)
@@ -641,8 +641,7 @@ float tab_backward;
 void HUD_Panel_FirstInDrawQ(float id);
 void reset_tab_panels()
 {
-       int i;
-       for(i = 0; i < hud_panels_COUNT; ++i)
+       for (int i = 0; i < hud_panels_COUNT; ++i)
                tab_panels[i] = world;
 }
 float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
index 0ccdbf2f033a65544a772e3f453c21390f1f7ded..fda7887b1641d74d55f3b8a2e3c9ded8e36d7874 100644 (file)
@@ -18,6 +18,7 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan
 
 void DrawAmmoItem(vector myPos, vector mySize, .int ammoType, bool isCurrent, bool isInfinite)
 {
+    TC(bool, isCurrent); TC(bool, isInfinite);
        if(ammoType == ammo_none)
                return;
 
index cde2b501c8c324d43167b008e97be0f1fdaf5807..99e8baaa65807a2a390b85050a1f53a1c70838a7 100644 (file)
@@ -17,6 +17,7 @@ bool centerprint_showing;
 
 void centerprint_generic(int new_id, string strMessage, float duration, int countdown_num)
 {
+    TC(int, new_id); TC(int, countdown_num);
        //printf("centerprint_generic(%d, '%s^7', %d, %d);\n", new_id, strMessage, duration, countdown_num);
        int i, j;
 
@@ -91,8 +92,9 @@ void centerprint_generic(int new_id, string strMessage, float duration, int coun
        centerprint_countdown_num[j] = countdown_num;
 }
 
-void centerprint_kill(float id)
+void centerprint_kill(int id)
 {
+    TC(int, id);
        centerprint_generic(id, "", 0, 0);
 }
 
@@ -103,8 +105,7 @@ void centerprint_hud(string strMessage)
 
 void reset_centerprint_messages()
 {
-       int i;
-       for (i=0; i<CENTERPRINT_MAX_MSGS; ++i)
+       for (int i=0; i<CENTERPRINT_MAX_MSGS; ++i)
        {
                centerprint_expire_time[i] = 0;
                centerprint_time[i] = 1;
index 727272e2ad2e6f5141edecf470277b1959035f5b..fbc98e0a5a03cd1e0f0eca7dd1b93d22ae60ddca 100644 (file)
@@ -10,6 +10,7 @@ bool mod_active; // is there any active mod icon?
 
 void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i)
 {
+    TC(int, layout); TC(int, i);
        int stat = -1;
        string pic = "";
        vector color = '0 0 0';
@@ -630,6 +631,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
 
 void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i)
 {
+    TC(int, layout); TC(int, i);
        float stat = -1;
        string pic = "";
        vector color = '0 0 0';
index b4118e8445e7a3574c554e73afe92fec631edb22..31a00794e3ed7977c2eb4bb04480831a2791191b 100644 (file)
@@ -44,6 +44,7 @@ void addPowerupItem(string name, string icon, vector color, float currentTime, f
 
 int getPowerupItemAlign(int align, int column, int row, int columns, int rows, bool isVertical)
 {
+    TC(int, align); TC(int, column); TC(int, row); TC(int, columns); TC(int, rows); TC(bool, isVertical);
        if(align < 2)
                return align;
 
index a70e0416af155d768d9510b15aaf2427bbef8c9a..4a2e7ee2b345165afc75e18399b9c1de8147ab2f 100644 (file)
@@ -15,6 +15,7 @@ float HUD_Radar_Clickable()
 
 void HUD_Radar_Show_Maximized(bool doshow,float clickable)
 {
+    TC(bool, doshow);
        hud_panel_radar_maximized = doshow;
        hud_panel_radar_temp_hidden = 0;
 
@@ -42,8 +43,9 @@ void HUD_Radar_Hide_Maximized()
 }
 
 
-float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary)
+float HUD_Radar_InputEvent(int bInputType, float nPrimary, float nSecondary)
 {
+    TC(int, bInputType);
        if(!hud_panel_radar_maximized || !hud_panel_radar_mouse ||
                autocvar__hud_configure || mv_active)
                return false;
index 1590c32d3c8ce37ffebcf83717b59030baddab9e..44499566eea72d8c8a7ec9bac9d1583e1c0d1051 100644 (file)
@@ -4,6 +4,7 @@
 entity weaponorder[Weapons_MAX];
 void weaponorder_swap(int i, int j, entity pass)
 {
+    TC(int, i); TC(int, j);
        entity h = weaponorder[i];
        weaponorder[i] = weaponorder[j];
        weaponorder[j] = h;
@@ -12,6 +13,7 @@ void weaponorder_swap(int i, int j, entity pass)
 string weaponorder_cmp_str;
 int weaponorder_cmp(int i, int j, entity pass)
 {
+    TC(int, i); TC(int, j);
        int ai = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[i].m_id), 0);
        int aj = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[j].m_id), 0);
        return aj - ai; // the string is in REVERSE order (higher prio at the right is what we want, but higher prio first is the string)
index ded6d5b32a9f2d1d4321dbea3b8b37254533684b..8b6e585288ec54530db29d28101617b4e1483b72 100644 (file)
@@ -219,6 +219,7 @@ void Shutdown()
 .float has_team;
 float SetTeam(entity o, int Team)
 {
+    TC(int, Team);
        devassert_once(Team);
        entity tm;
        if(teamplay)
@@ -351,8 +352,9 @@ void PostInit()
 // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
 // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
 // In the case of mouse input after a setcursormode(1) call, nPrimary is xpos, nSecondary is ypos.
-float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
+float CSQC_InputEvent(int bInputType, float nPrimary, float nSecondary)
 {
+    TC(int, bInputType);
        if (HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary))
                return true;
 
index 7071231651b2b69149bbbd2bf226abfe1df95496..3223bf120aa7cc012f9143e21bc671f12ee9031b 100644 (file)
@@ -41,6 +41,7 @@ int n_ssdirs;
 
 string MapVote_FormatMapItem(int id, string map, float _count, float maxwidth, vector fontsize)
 {
+    TC(int, id);
        string pre, post;
        pre = sprintf("%d. ", id+1);
        if(mv_detail)
@@ -61,6 +62,7 @@ string MapVote_FormatMapItem(int id, string map, float _count, float maxwidth, v
 
 vector MapVote_RGB(int id)
 {
+    TC(int, id);
        if(!(mv_flags[id] & GTV_AVAILABLE))
                return '1 1 1';
        if(id == mv_ownvote)
@@ -73,6 +75,7 @@ vector MapVote_RGB(int id)
 
 void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string gtype, string pic, float _count, int id)
 {
+    TC(int, id);
        // Find the correct alpha
        float alpha;
        if(!(mv_flags_start[id] & GTV_AVAILABLE))
@@ -183,6 +186,7 @@ void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string g
 
 void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float _count, int id)
 {
+    TC(int, id);
        vector img_size = '0 0 0';
        string label;
        float text_size;
@@ -256,6 +260,7 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin
 
 void MapVote_DrawAbstain(vector pos, float isize, float tsize, float _count, int id)
 {
+    TC(int, id);
        vector rgb;
        float text_size;
        string label;
@@ -272,6 +277,7 @@ void MapVote_DrawAbstain(vector pos, float isize, float tsize, float _count, int
 
 vector MapVote_GridVec(vector gridspec, int i, int m)
 {
+    TC(int, i); TC(int, m);
        int r = i % m;
        return
                '1 0 0' * (gridspec.x * r)
@@ -485,8 +491,9 @@ void MapVote_Draw()
        draw_cursor_normal(mv_mousepos, '1 1 1', 1 - autocvar__menu_alpha);
 }
 
-void Cmd_MapVote_MapDownload(float argc)
+void Cmd_MapVote_MapDownload(int argc)
 {
+    TC(int, argc);
        entity pak;
 
        if(argc != 2 || !mv_pk3list)
@@ -517,6 +524,7 @@ void Cmd_MapVote_MapDownload(float argc)
 
 void MapVote_CheckPK3(string pic, string pk3, int id)
 {
+    TC(int, id);
        entity pak;
        pak = spawn();
        pak.netname = pk3;
@@ -538,6 +546,7 @@ void MapVote_CheckPK3(string pic, string pk3, int id)
 
 void MapVote_CheckPic(string pic, string pk3, int id)
 {
+    TC(int, id);
        // never try to retrieve a pic for the "don't care" 'map'
        if(mv_abstain && id == mv_num_maps - 1)
                return;
@@ -580,6 +589,7 @@ void MapVote_ReadMask()
 
 void MapVote_ReadOption(int i)
 {
+    TC(int, i);
        string map = strzone(ReadString());
        string pk3 = strzone(ReadString());
        int j = bound(0, ReadByte(), n_ssdirs - 1);
@@ -596,6 +606,7 @@ void MapVote_ReadOption(int i)
 
 void GameTypeVote_ReadOption(int i)
 {
+    TC(int, i);
        string gt = strzone(ReadString());
 
        mv_maps[i] = gt;
@@ -687,13 +698,15 @@ void MapVote_Init()
        n_ssdirs = 0;
 }
 
-void MapVote_SendChoice(float index)
+void MapVote_SendChoice(int index)
 {
+    TC(int, index);
        localcmd(strcat("\nimpulse ", ftos(index+1), "\n"));
 }
 
 int MapVote_MoveLeft(int pos)
 {
+    TC(int, pos);
        int imp;
        if ( pos < 0 )
                imp = mv_num_maps - 1;
@@ -705,6 +718,7 @@ int MapVote_MoveLeft(int pos)
 }
 int MapVote_MoveRight(int pos)
 {
+    TC(int, pos);
        int imp;
        if ( pos < 0 )
                imp = 0;
@@ -716,6 +730,7 @@ int MapVote_MoveRight(int pos)
 }
 int MapVote_MoveUp(int pos)
 {
+    TC(int, pos);
        int imp;
        if ( pos < 0 )
                imp = mv_num_maps - 1;
@@ -735,6 +750,7 @@ int MapVote_MoveUp(int pos)
 }
 int MapVote_MoveDown(int pos)
 {
+    TC(int, pos);
        int imp;
        if ( pos < 0 )
                imp = 0;
@@ -749,8 +765,9 @@ int MapVote_MoveDown(int pos)
        return imp;
 }
 
-float MapVote_InputEvent(float bInputType, float nPrimary, float nSecondary)
+float MapVote_InputEvent(int bInputType, float nPrimary, float nSecondary)
 {
+    TC(int, bInputType);
        float imp;
 
        if (!mv_active)
index fd83aa2d11ed8a9791a4f539a9b0045e111cf00a..970a681e37b202f9bfc2a49c6f2c6377b0a13715 100644 (file)
@@ -119,6 +119,7 @@ void RemoveTeam(entity Team)
 
 entity GetTeam(int Team, bool add)
 {
+    TC(int, Team); TC(bool, add);
        int num = (Team == NUM_SPECTATOR) ? 16 : Team;
        if(teamslots[num])
                return teamslots[num];
@@ -159,6 +160,7 @@ float PreviewExists(string name)
 // decolorizes and team colors the player name when needed
 string playername(string thename, float teamid)
 {
+    TC(int, teamid);
     string t;
     if (teamplay)
     {
@@ -483,8 +485,9 @@ void DrawCircleClippedPic(vector centre, float radi, string pic, float f, vector
 }
 
 /** engine callback */
-void URI_Get_Callback(int id, float status, string data)
+void URI_Get_Callback(int id, int status, string data)
 {
+    TC(int, id); TC(int, status);
        if(url_URI_Get_Callback(id, status, data))
        {
                // handled
index 7fa065ca4a42d9912906be6e69697d7ce9968a10..49da661ad69cfdcc076ab0571a9ac073342aa052 100644 (file)
@@ -79,8 +79,9 @@ void skeleton_markbones(entity e)
        }
 }
 
-void skel_set_boneabs(float s, float bone, vector absorg)
+void skel_set_boneabs(float s, int bone, vector absorg)
 {
+    TC(int, bone);
        vector absang = fixedvectoangles2(v_forward, v_up);
 
        vector parentorg = skel_get_boneabs(s, skel_get_boneparent(s, bone));
@@ -108,8 +109,9 @@ void free_skeleton_from_frames(entity e)
        }
 }
 
-void skeleton_from_frames(entity e, float is_dead)
+void skeleton_from_frames(entity e, bool is_dead)
 {SELFPARAM();
+    TC(bool, is_dead);
        float m = e.modelindex;
        if(!e.skeletonindex)
        {
index 0208fc1828c305fd8d1db0af696689e11fff0230..6d281aa6b6a578b919efacc0d262534d61f95e99 100644 (file)
@@ -38,6 +38,7 @@ float QuickMenu_TimeOut;
 // if s1 is not empty s will be displayed as command otherwise as submenu
 void QuickMenu_Page_LoadEntry(int i, string s, string s1)
 {
+    TC(int, i);
        //printf("^xc80 entry %d: %s, %s\n", i, s, s1);
        if (QuickMenu_Page_Description[i])
                strunzone(QuickMenu_Page_Description[i]);
@@ -49,6 +50,7 @@ void QuickMenu_Page_LoadEntry(int i, string s, string s1)
 
 void QuickMenu_Page_ClearEntry(int i)
 {
+    TC(int, i);
        if (QuickMenu_Page_Description[i])
                strunzone(QuickMenu_Page_Description[i]);
        QuickMenu_Page_Description[i] = string_null;
@@ -228,9 +230,10 @@ bool QuickMenu_IsOpened()
        return (QuickMenu_Page_Entries > 0);
 }
 
-void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, float without_me);
-bool HUD_Quickmenu_PlayerListEntries_Create(string cmd, int teamplayers, float without_me)
+void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me);
+bool HUD_Quickmenu_PlayerListEntries_Create(string cmd, int teamplayers, bool without_me)
 {
+    TC(int, teamplayers); TC(bool, without_me);
        int i;
        for(i = 0; i < QUICKMENU_MAXLINES; ++i)
                QuickMenu_Page_ClearEntry(i);
@@ -253,8 +256,9 @@ bool HUD_Quickmenu_PlayerListEntries_Create(string cmd, int teamplayers, float w
 
 // new_page 0 means page 0, new_page != 0 means next page
 int QuickMenu_Buffer_Index_Prev;
-bool QuickMenu_Page_Load(string target_submenu, int new_page)
+bool QuickMenu_Page_Load(string target_submenu, bool new_page)
 {
+    TC(bool, new_page);
        string s = string_null, cmd = string_null, z_submenu;
 
        if (new_page == 0)
@@ -363,6 +367,7 @@ bool QuickMenu_Page_Load(string target_submenu, int new_page)
 
 bool QuickMenu_ActionForNumber(int num)
 {
+    TC(int, num);
        if (!QuickMenu_IsLastPage)
        {
                if (num < 0 || num >= QUICKMENU_MAXLINES)
@@ -388,8 +393,9 @@ bool QuickMenu_ActionForNumber(int num)
        return false;
 }
 
-void QuickMenu_Page_ActiveEntry(float entry_num)
+void QuickMenu_Page_ActiveEntry(int entry_num)
 {
+    TC(int, entry_num);
        QuickMenu_Page_ActivatedEntry = entry_num;
        QuickMenu_Page_ActivatedEntry_Time = time + 0.1;
        if(QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
@@ -405,8 +411,9 @@ void QuickMenu_Page_ActiveEntry(float entry_num)
                QuickMenu_Page_ActivatedEntry_Close = (!(hudShiftState & S_CTRL));
 }
 
-bool QuickMenu_InputEvent(float bInputType, float nPrimary, float nSecondary)
+bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary)
 {
+    TC(int, bInputType);
        // we only care for keyboard events
        if(bInputType == 2)
                return false;
@@ -744,8 +751,9 @@ void HUD_QuickMenu()
                QUICKMENU_ENTRY(strcat("(", prvm_language, ")", title), sprintf(command, translated_text)) \
 }
 
-void HUD_Quickmenu_PlayerListEntries(string cmd, float teamplayers, float without_me)
+void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me)
 {
+    TC(int, teamplayers); TC(bool, without_me);
        entity pl;
        if(teamplayers && !team_count)
                return;
index a99db0360c01da61abcca4fc96161ca44c5a6b6e..cf25209c769d6edbc7492eea099ddadda51efa35 100644 (file)
@@ -128,8 +128,9 @@ void HUD_UpdatePlayerTeams()
        */
 }
 
-int HUD_CompareScore(float vl, float vr, int f)
+int HUD_CompareScore(int vl, int vr, int f)
 {
+    TC(int, vl); TC(int, vr); TC(int, f);
        if(f & SFL_ZERO_IS_WORST)
        {
                if(vl == 0 && vr != 0)
@@ -313,8 +314,9 @@ void Cmd_HUD_Help()
 "+as/objectives +nb/faults +nb/goals +ka/pickups +ka/bckills +ka/bctime +ft/revivals " \
 "-lms,rc,nb/score"
 
-void Cmd_HUD_SetFields(float argc)
+void Cmd_HUD_SetFields(int argc)
 {
+    TC(int, argc);
        int i, j, slash;
        string str, pattern;
        float have_name = 0, have_primary = 0, have_secondary = 0, have_separator = 0;
@@ -516,6 +518,7 @@ float hud_field_icon1_alpha;
 float hud_field_icon2_alpha;
 string HUD_GetField(entity pl, int field)
 {
+    TC(int, field);
        float tmp, num, denom;
        int f;
        string str;
@@ -640,6 +643,7 @@ float hud_fixscoreboardcolumnwidth_marginlen;
 
 string HUD_FixScoreboardColumnWidth(int i, string str)
 {
+    TC(int, i);
        float field, f;
        vector sz;
        field = hud_field[i];
@@ -704,8 +708,9 @@ string HUD_FixScoreboardColumnWidth(int i, string str)
        return str;
 }
 
-void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_self, int pl_number)
+void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, bool is_self, int pl_number)
 {
+    TC(bool, is_self); TC(int, pl_number);
        vector tmp, rgb;
        rgb = Team_ColorRGB(pl.team);
        string str;
index 96fd5ee977695877739119e0ba69427588649859..01388fdd2ff7ad69609cc6f00ea671df7df98724 100644 (file)
@@ -148,6 +148,7 @@ void draw_teamradar_icon(vector coord, entity icon, entity pingdata, vector rgb,
 
 void draw_teamradar_link(vector start, vector end, int colors)
 {
+    TC(int, colors);
        vector c0, c1, norm;
 
        start = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(start));
index a52794ec594be9173527675b05bc8cc5c2fcf405..6e8487b96ae4cef8c41443addbef3864668c7fc8 100644 (file)
@@ -1352,6 +1352,7 @@ float vh_notice_time;
 void WaypointSprite_Load();
 void CSQC_UpdateView(float w, float h)
 {SELFPARAM();
+    TC(int, w); TC(int, h);
        entity e;
        float fov;
        float f;
index c8e246a06e3dd6a0ab79170802846d19538c37e0..ea2f5f3d6dc87be3ac19515754715556755dd638 100644 (file)
@@ -171,6 +171,7 @@ void Projectile_Draw(entity this)
 
 void loopsound(entity e, int ch, string samp, float vol, float attn)
 {
+    TC(int, ch);
        if (e.silent)
                return;
 
index 79cba7f927948707451f4707b52cb6f4e33975fd..3bca324529d6d9f973bf22b4eb1fa760bdb664cf 100644 (file)
@@ -112,7 +112,7 @@ ENDCLASS(CallbackChain)
 #define _MUTATOR_HANDLE_NOP(type, id)
 #define _MUTATOR_HANDLE_PARAMS(type, id) , type in_##id
 #define _MUTATOR_HANDLE_PREPARE(type, id) id = in_##id;
-#define _MUTATOR_HANDLE_PUSHTMP(type, id) type tmp_##id = id;
+#define _MUTATOR_HANDLE_PUSHTMP(type, id) TC(type, id); type tmp_##id = id;
 #define _MUTATOR_HANDLE_PUSHOUT(type, id) type out_##id = id;
 #define _MUTATOR_HANDLE_POPTMP(type, id) id = tmp_##id;
 #define _MUTATOR_HANDLE_POPOUT(type, id) id = out_##id;
index 212ba4a5de566b0b0894a336f2d6dd54365dda0e..97d560b5c4708542a199781e853fa87b2b99af1d 100644 (file)
 
 #include "macro.qh"
 
-#ifndef NDEBUG
+#if NDEBUG
+    #define TC(T, sym) MACRO_BEGIN MACRO_END
+#else
     #define TC(T, sym) MACRO_BEGIN \
         if (!is_##T(sym)) LOG_WARNINGF("Type check failed: " #sym " :: " #T); \
     MACRO_END
-#else
-    #define TC(T, sym) MACRO_BEGIN MACRO_END
 #endif
 
-bool is_int(float f) { return f == f | 0; }
-bool is_bool(float f) { return f == true || f == false; }
+bool is_float (float  this) { return true; }
+bool is_vector(vector this) { return true; }
+bool is_string(string this) { return true; }
+bool is_entity(entity this) { return true; }
+bool is_int   (float  this) { return this == floor(this); }
+bool is_bool  (float  this) { return this == true || this == false; }
 
 #include "warpzone/mathlib.qc"
 
index f12a715aa31c3e1bd281763a731fcaff5229f4fd..686b47d8673c48fbefc98ed18fdeb2f10fbb40b0 100644 (file)
@@ -11,7 +11,7 @@ const string STR_OBSERVER = "observer";
 #define IS_OBSERVER(v) ((v).classname == STR_OBSERVER)
 
 #define IS_CLIENT(v) (v.flags & FL_CLIENT)
-#define is_client IS_CLIENT
+#define is_Client IS_CLIENT
 #define IS_BOT_CLIENT(v) (clienttype(v) == CLIENTTYPE_BOT)
 #define IS_REAL_CLIENT(v) (clienttype(v) == CLIENTTYPE_REAL)
 #define IS_NOT_A_CLIENT(v) (clienttype(v) == CLIENTTYPE_NOTACLIENT)