]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/counting.qh
Rename defs to qh
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / counting.qh
index 1413a80902d1fb338abed1881ea942c2929bf608..c5c95671cf9ae2ec4600bf0fe304a496d46ff296 100644 (file)
@@ -1,3 +1,62 @@
+#ifndef COUNTING_H
+#define COUNTING_H
+
+#if defined(CSQC)
+       #include "util-pre.qh"
+       #include "../client/sys-pre.qh"
+       #include "../dpdefs/csprogsdefs.qh"
+       #include "../client/sys-post.qh"
+       #include "../client/defs.qh"
+       #include "../dpdefs/keycodes.qh"
+       #include "constants.qh"
+       #include "stats.qh"
+       #include "../warpzonelib/anglestransform.qh"
+       #include "../warpzonelib/mathlib.qh"
+       #include "../warpzonelib/common.qh"
+       #include "../warpzonelib/client.qh"
+       #include "playerstats.qh"
+       #include "teams.qh"
+       #include "util.qh"
+       #include "nades.qh"
+       #include "buffs.qh"
+       #include "test.qh"
+#elif defined(MENUQC)
+       #include "util-pre.qh"
+    #include "../menu/sys-pre.qh"
+    #include "../dpdefs/menudefs.qh"
+    #include "../dpdefs/keycodes.qh"
+    #include "../menu/sys-post.qh"
+    #include "../menu/config.qh"
+    #include "../warpzonelib/mathlib.qh"
+    #include "util.qh"
+    #include "test.qh"
+    #include "../menu/oo/base.qh"
+    #include "playerstats.qh"
+    #include "teams.qh"
+    #include "constants.qh"
+    #include "mapinfo.qh"
+    #include "campaign_common.qh"
+    #include "weapons/weapons.qh"
+#elif defined(SVQC)
+       #include "util-pre.qh"
+    #include "../server/sys-pre.qh"
+    #include "../dpdefs/progsdefs.qh"
+    #include "../dpdefs/dpextensions.qh"
+    #include "../server/sys-post.qh"
+    #include "../warpzonelib/anglestransform.qh"
+    #include "../warpzonelib/mathlib.qh"
+    #include "../warpzonelib/common.qh"
+    #include "../warpzonelib/util_server.qh"
+    #include "../warpzonelib/server.qh"
+    #include "constants.qh"
+    #include "stats.qh"
+    #include "teams.qh"
+    #include "util.qh"
+    #include "nades.qh"
+    #include "buffs.qh"
+    #include "test.qh"
+#endif
+
 // ===============================================
 //  Time processing and counting functions/macros
 // ===============================================
                ZCTX(_("CI_THI^%d seconds")), /* third */ \
                ZCTX(_("CI_MUL^%d seconds"))) /* multi */
 
-string count_ordinal(float interval)
+string count_ordinal(int interval)
 {
        // This function is designed primarily for the English language, it's impossible
        // to accomodate all languages unless we do a specific function for each one...
@@ -60,10 +119,10 @@ string count_ordinal(float interval)
        // Basically, it just allows you to represent a number or count in different ways
        // depending on the number... like, with count_ordinal you can provide integers
        // and retrieve 1st, 2nd, 3rd, nth ordinal numbers in a clean and simple way.
-       if(floor((mod(interval, 100))/10) * 10 != 10) // examples: 12th, 111th, 213th will not execute this block
+       if(floor((interval % 100)/10) * 10 != 10) // examples: 12th, 111th, 213th will not execute this block
        {
                // otherwise, check normally for 1st,2nd,3rd insertions
-               switch(mod(interval, 10))
+               switch(interval % 10)
                {
                        case 1: return sprintf(_("%dst"), interval);
                        case 2: return sprintf(_("%dnd"), interval);
@@ -215,3 +274,4 @@ string process_time(float outputtype, float seconds)
        }
        return "";
 }
+#endif
\ No newline at end of file