]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_world.qc
Merge remote branch 'refs/remotes/origin/terencehill/newpanelhud'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index ad9341e2d0f947e6aec137e193b3b5f0650d8a4d..9df213c1b8b3748ef74551d84b60239865dab0d3 100644 (file)
@@ -512,6 +512,8 @@ void spawnfunc_worldspawn (void)
        InitGameplayMode();
        readlevelcvars();
        GrappleHookInit();
+       ElectroInit();
+       LaserInit();
 
        player_count = 0;
        bot_waypoints_for_items = cvar("g_waypoints_for_items");
@@ -539,6 +541,11 @@ void spawnfunc_worldspawn (void)
 
                GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", s));
                s = ":gameinfo:mutators:LIST";
+
+               ret_string = s;
+               MUTATOR_CALLHOOK(BuildMutatorsString);
+               s = ret_string;
+
                if(cvar("g_grappling_hook"))
                        s = strcat(s, ":grappling_hook");
                if(!cvar("g_use_ammunition"))
@@ -547,8 +554,6 @@ void spawnfunc_worldspawn (void)
                        s = strcat(s, ":no_pickup_items");
                if(cvar_string("g_weaponarena") != "0")
                        s = strcat(s, ":", cvar_string("g_weaponarena"), " arena");
-               if(cvar("g_nixnex"))
-                       s = strcat(s, ":nixnex");
                if(cvar("g_vampire"))
                        s = strcat(s, ":vampire");
                if(cvar("g_laserguided_missile"))
@@ -632,6 +637,11 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
        addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);
 
+       // g_movementspeed hack
+       addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw);
+       addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
+       addstat(STAT_MOVEVARS_AIRSTRAFEACCEL_QW, AS_FLOAT, stat_sv_airstrafeaccel_qw);
+
        next_pingtime = time + 5;
        InitializeEntity(self, cvar_changes_init, INITPRIO_CVARS);
 
@@ -691,7 +701,22 @@ void spawnfunc_worldspawn (void)
 
        CheatInit();
 
-       localcmd("\n_sv_hook_gamestart ", GetGametype(), ";");
+       localcmd("\n_sv_hook_gamestart ", GetGametype(), "\n");
+
+       // fill sv_curl_serverpackages from .serverpackage files
+       if(cvar("sv_curl_serverpackages_auto"))
+       {
+               fd = search_begin("*.serverpackage", TRUE, FALSE);
+               s = "";
+               if(fd >= 0)
+               {
+                       j = search_getsize(fd);
+                       for(i = 0; i < j; ++i)
+                               s = strcat(s, " ", search_getfilename(fd, i));
+                       search_end(fd);
+               }
+               cvar_set("sv_curl_serverpackages", substring(s, 1, -1));
+       }
 
        world_initialized = 1;
 }
@@ -1419,7 +1444,7 @@ void NextLevel()
        if(cvar("g_campaign"))
                CampaignPreIntermission();
 
-       localcmd("\nsv_hook_gameend;");
+       localcmd("\nsv_hook_gameend\n");
 }
 
 /*
@@ -1732,6 +1757,8 @@ void ShuffleMaplist()
 float leaderfrags;
 float WinningCondition_Scores(float limit, float leadlimit)
 {
+       float limitreached;
+
        // TODO make everything use THIS winning condition (except LMS)
        WinningConditionHelper();
 
@@ -1776,13 +1803,22 @@ float WinningCondition_Scores(float limit, float leadlimit)
                }
        }
 
+       limitreached = FALSE;
+       if(limit)
+               if(WinningConditionHelper_topscore >= limit)
+                       limitreached = TRUE;
+       if(leadlimit)
+       {
+               float leadlimitreached;
+               leadlimitreached = (WinningConditionHelper_topscore - WinningConditionHelper_secondscore >= leadlimit);
+               if(cvar("leadlimit_and_fraglimit"))
+                       limitreached = (limitreached && leadlimitreached);
+               else
+                       limitreached = (limitreached || leadlimitreached);
+       }
+
        return GetWinningCode(
-               WinningConditionHelper_topscore &&
-               (
-                       (limit && (WinningConditionHelper_topscore >= limit))
-                       ||
-                       (leadlimit && (WinningConditionHelper_topscore - WinningConditionHelper_secondscore >= leadlimit))
-               ),
+               WinningConditionHelper_topscore && limitreached,
                WinningConditionHelper_equality
        );
 }
@@ -2694,6 +2730,7 @@ float RedirectionThink()
        return TRUE;
 }
 
+void TargetMusic_RestoreGame();
 void RestoreGame()
 {
        // Loaded from a save game
@@ -2707,6 +2744,8 @@ void RestoreGame()
        MapInfo_Enumerate();
        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1);
        WeaponStats_Init();
+
+       TargetMusic_RestoreGame();
 }
 
 void SV_Shutdown()