]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/all.qh
Merge branch 'master' into terencehill/menu_optimization
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / all.qh
index 48ff80418c21c46bbc4339dee5a0d5b66203f78e..3867cf1edd5490b7403750de6f38a5c12c436606 100644 (file)
@@ -1,10 +1,28 @@
+#ifndef VEHICLES_ALL_H
+#define VEHICLES_ALL_H
+
+#include "vehicle.qh"
+
+REGISTRY(Vehicles, BITS(3))
+#define Vehicles_from(i) _Vehicles_from(i, VEH_Null)
+#define get_vehicleinfo(i) Vehicles_from(i)
+REGISTER_REGISTRY(Vehicles)
+REGISTRY_CHECK(Vehicles)
+
+const int VEH_FIRST = 1;
+#define VEH_LAST (Vehicles_COUNT - 1)
+
+/** If you register a new vehicle, make sure to add it to all.inc */
+#define REGISTER_VEHICLE(id, inst) REGISTER(Vehicles, VEH, id, vehicleid, inst)
+
 #if defined(SVQC)
        #include "sv_vehicles.qh"
 #elif defined(CSQC)
        #include "cl_vehicles.qh"
 #endif
 
-#   ifndef VEHICLES_NO_UNSTABLE
-#       include "unit/bumblebee.qh"
-#       include "unit/raptor.qh"
-#   endif
+REGISTER_VEHICLE(Null, NEW(Vehicle));
+
+#include "all.inc"
+
+#endif