From: Mario Date: Thu, 28 Jul 2016 12:00:22 +0000 (+1000) Subject: Add an intrusive list for vehicles X-Git-Tag: xonotic-v0.8.2~752^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=96a1afd77d3d15a67150fb0899e53af6f02e60f3;p=xonotic%2Fxonotic-data.pk3dir.git Add an intrusive list for vehicles --- diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 82b20a6bc..8677e1619 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -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 != "") { diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index a1c180cef..3f6f392b6 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -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(); } diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qc b/qcsrc/server/mutators/mutator/gamemode_assault.qc index 6ce572437..d08b5a26e 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@ -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;