]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Spawn vehicles according to g_start_delay and make work better g_vehicles_delayspawn_...
authorterencehill <piuntn@gmail.com>
Thu, 20 Jun 2013 22:38:10 +0000 (00:38 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 20 Jun 2013 22:38:10 +0000 (00:38 +0200)
qcsrc/server/vehicles/vehicles.qc

index 1e78bd5a28eec14fc7cffa9f5e9703ccffd09bc6..172f85000f496726be7826169d9868b7b6581f8c 100644 (file)
@@ -1273,15 +1273,14 @@ float vehicle_initialize(string  net_name,
     self.event_damage        = func_null;
     self.touch               = vehicles_touch;
     self.think               = vehicles_spawn;
-    self.nextthink           = time;
     self.vehicle_respawntime = _respawntime;
     self.vehicle_spawn       = spawnproc;
     self.effects             = EF_NODRAW;
        self.dphitcontentsmask   = DPCONTENTS_BODY | DPCONTENTS_SOLID;
-    if(!autocvar_g_vehicles_delayspawn)
-        self.nextthink = time + game_starttime;
-    else
-        self.nextthink = time + _respawntime + (random() * autocvar_g_vehicles_delayspawn_jitter);
+       if(!autocvar_g_vehicles_delayspawn)
+               self.nextthink = time;
+       else
+               self.nextthink = max(time, game_starttime) + _respawntime + ((random() * 2 - 1) * autocvar_g_vehicles_delayspawn_jitter);
 
        if(autocvar_g_playerclip_collisions)
                self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;