]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an intrusive list for vehicles
authorMario <mario@smbclan.net>
Thu, 28 Jul 2016 12:00:22 +0000 (22:00 +1000)
committerMario <mario@smbclan.net>
Thu, 28 Jul 2016 12:00:22 +0000 (22:00 +1000)
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/server/defs.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc

index 82b20a6bc21776e29c5a966720bfe032ffb008b7..8677e16195687a6e1de03b83be9feb7749b7bd58 100644 (file)
@@ -1096,7 +1096,10 @@ bool vehicle_initialize(entity this, Vehicle info, bool nodrop)
                return false;
 
        if(!this.tur_head)
+       {
                info.vr_precache(info);
+               IL_PUSH(g_vehicles, this);
+       }
 
        if(this.targetname && this.targetname != "")
        {
index a1c180cef831779830352ecfe6c0ad67c43409a7..3f6f392b63046cc47edc6acec343d6e073184dad 100644 (file)
@@ -449,3 +449,6 @@ STATIC_INIT(g_monsters) { g_monsters = IL_NEW(); }
 
 IntrusiveList g_waypoints;
 STATIC_INIT(g_waypoints) { g_waypoints = IL_NEW(); }
+
+IntrusiveList g_vehicles;
+STATIC_INIT(g_vehicles) { g_vehicles = IL_NEW(); }
index 6ce57243770c2171dffdb747bf8f341b59d968b9..d08b5a26e1ad605c4a0697e43cd7f6fec7f7bbbb 100644 (file)
@@ -259,10 +259,11 @@ void assault_new_round(entity this)
        // Eject players from vehicles
     FOREACH_CLIENT(IS_PLAYER(it) && it.vehicle, vehicles_exit(it.vehicle, VHEF_RELEASE));
 
-    FOREACH_ENTITY_FLAGS(vehicle_flags, VHF_ISVEHICLE, LAMBDA(
+    IL_EACH(g_vehicles, true,
+    {
         vehicles_clearreturn(it);
         vehicles_spawn(it);
-    ));
+    });
 
        // up round counter
        this.winning = this.winning + 1;