]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/mapvoting.qc
Merge branch 'master' into Mario/q3compat_sanity
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / mapvoting.qc
index 76c1e75fcceaeeffbc421893db42d0b2668b65e3..e517e76dee4300bc6ec16589efabf9e59219a93e 100644 (file)
@@ -1,11 +1,9 @@
 #include "mapvoting.qh"
 
-#include "autocvars.qh"
-#include "main.qh"
-#include "miscfunctions.qh"
-#include "hud/_mod.qh"
-#include "hud/panel/scoreboard.qh"
-
+#include <client/autocvars.qh>
+#include <client/draw.qh>
+#include <client/hud/_mod.qh>
+#include <client/hud/panel/scoreboard.qh>
 #include <common/mapinfo.qh>
 #include <common/util.qh>
 
@@ -49,6 +47,19 @@ const int NUM_SSDIRS = 4;
 string ssdirs[NUM_SSDIRS];
 int n_ssdirs;
 
+bool PreviewExists(string name)
+{
+       if(autocvar_cl_readpicture_force)
+               return false;
+
+       if (fexists(strcat(name, ".tga"))) return true;
+       if (fexists(strcat(name, ".png"))) return true;
+       if (fexists(strcat(name, ".jpg"))) return true;
+       if (fexists(strcat(name, ".pcx"))) return true;
+
+       return false;
+}
+
 string MapVote_FormatMapItem(int id, string map, float _count, float maxwidth, vector fontsize)
 {
        TC(int, id);