]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/main.qc
Fix string length checks in world.qc and add VM_TEMPSTRING_MAXSIZE
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / main.qc
index 7c010ad86ad29214bf6f377411339b5b463dbde6..b5832d8939ae91b28b44f671007e9a619d5ec44f 100644 (file)
@@ -294,12 +294,6 @@ void systems_update();
 void sys_phys_update(entity this, float dt);
 void StartFrame()
 {
-       IL_EACH(g_moveables, it.last_pushed,
-       {
-               if(!WarpZoneLib_ExactTrigger_Touch(it.last_pushed, it, false))
-                       it.last_pushed = NULL;
-       });
-
        // TODO: if move is more than 50ms, split it into two moves (this matches QWSV behavior and the client prediction)
        IL_EACH(g_players, IS_FAKE_CLIENT(it), sys_phys_update(it, frametime));
        IL_EACH(g_players, IS_FAKE_CLIENT(it), PlayerPreThink(it));
@@ -483,6 +477,32 @@ string GetField_fullspawndata(entity e, string f, ...)
        return v;
 }
 
+/*
+=============
+FindFileInMapPack
+
+Returns the first matching VFS file path that exists in the current map's pack.
+Returns string_null if no files match or the map isn't packaged.
+=============
+*/
+string FindFileInMapPack(string pattern)
+{
+       if (!checkextension("DP_QC_FS_SEARCH_PACKFILE"))
+               return string_null;
+
+       string base_pack = whichpack(strcat("maps/", mapname, ".bsp"));
+       if (base_pack == "" || !base_pack) // this map isn't packaged or there was an error
+               return string_null;
+
+       int glob = search_packfile_begin(pattern, true, true, base_pack);
+       if (glob < 0)
+               return string_null;
+
+       string file = search_getfilename(glob, 0);
+       search_end(glob);
+       return file;
+}
+
 void WarpZone_PostInitialize_Callback()
 {
        // create waypoint links for warpzones