X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmain.qc;h=40e14c906bf858e544c321cf475cada1526a9024;hb=131d0d5343ee46646b08e6dc4915aeaa19f47f05;hp=f22347e8411632de37f40794976e87ad8b66ffbb;hpb=1bf5195756a7aa889e07c19dc32befa4e1ddebf7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/main.qc b/qcsrc/server/main.qc index f22347e84..40e14c906 100644 --- a/qcsrc/server/main.qc +++ b/qcsrc/server/main.qc @@ -294,9 +294,12 @@ void systems_update(); void sys_phys_update(entity this, float dt); void StartFrame() { - // 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)); + FOREACH_CLIENT(IS_FAKE_CLIENT(it), + { + // DP calls these for real clients only + sys_phys_update(it, frametime); // called by SV_PlayerPhysics for players + PlayerPreThink(it); + }); execute_next_frame(); @@ -365,8 +368,13 @@ void StartFrame() MUTATOR_CALLHOOK(SV_StartFrame); GlobalStats_updateglobal(); - FOREACH_CLIENT(true, GlobalStats_update(it)); - IL_EACH(g_players, IS_FAKE_CLIENT(it), PlayerPostThink(it)); + FOREACH_CLIENT(true, + { + GlobalStats_update(it); + if (IS_FAKE_CLIENT(it)) + PlayerPostThink(it); // DP calls this for real clients only + PlayerFrame(it); + }); } .vector originjitter; @@ -477,6 +485,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