]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_world.qc
Merge branch 'master' into TimePath/debug_draw
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index c706a1bdd5ad4288a89d81930af3ee97a743354b..b89f361506f6b6a8a05e2a61bf87bfbb8a5b688f 100644 (file)
@@ -83,8 +83,8 @@ void PingPLReport_Think()
 }
 void PingPLReport_Spawn()
 {
-       pingplreport = spawn();
-       pingplreport.classname = "pingplreport";
+       pingplreport = new(pingplreport);
+       make_pure(pingplreport);
        pingplreport.think = PingPLReport_Think;
        pingplreport.nextthink = time;
 }
@@ -528,7 +528,8 @@ void RandomSeed_Think()
 }
 void RandomSeed_Spawn()
 {SELFPARAM();
-       randomseed = spawn();
+       randomseed = new(randomseed);
+       make_pure(randomseed);
        randomseed.think = RandomSeed_Think;
        Net_LinkEntity(randomseed, false, 0, RandomSeed_Send);
 
@@ -546,19 +547,18 @@ spawnfunc(__init_dedicated_server)
 
        remove = remove_unsafely;
 
-       entity e;
-       e = spawn();
+       entity e = spawn();
        e.think = GotoFirstMap;
        e.nextthink = time; // this is usually 1 at this point
 
-       e = spawn();
-       e.classname = "info_player_deathmatch"; // safeguard against player joining
+       e = new(info_player_deathmatch);  // safeguard against player joining
 
        self.classname = "worldspawn"; // safeguard against various stuff ;)
 
        // needs to be done so early because of the constants they create
        static_init();
        static_init_late();
+       static_init_precache();
 
        MapInfo_Enumerate();
        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
@@ -658,6 +658,7 @@ spawnfunc(worldspawn)
 
        InitGameplayMode();
        static_init_late();
+       static_init_precache();
        readlevelcvars();
        GrappleHookInit();
 
@@ -1485,11 +1486,14 @@ void FixIntermissionClient(entity e)
                e.solid = SOLID_NOT;
                e.movetype = MOVETYPE_NONE;
                e.takedamage = DAMAGE_NO;
-               if(e.weaponentity)
+               for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
-                       e.weaponentity.effects = EF_NODRAW;
-                       if (e.weaponentity.weaponentity)
-                               e.weaponentity.weaponentity.effects = EF_NODRAW;
+                       if(e.weaponentity[slot])
+                       {
+                               e.weaponentity[slot].effects = EF_NODRAW;
+                               if (e.weaponentity[slot].weaponentity[slot])
+                                       e.weaponentity[slot].weaponentity[slot].effects = EF_NODRAW;
+                       }
                }
                if(IS_REAL_CLIENT(e))
                {