]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/vehicles/all.qh
Vehicles: prepare for upgrade
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / all.qh
1 #ifndef VEHICLES_ALL_H
2 #define VEHICLES_ALL_H
3
4 #include "vehicle.qh"
5
6 void RegisterVehicles();
7 const int VEH_MAXCOUNT = 24;
8 entity vehicle_info[VEH_MAXCOUNT], vehicle_info_first, vehicle_info_last;
9 int VEH_COUNT;
10 const int VEH_FIRST = 1;
11 #define VEH_LAST (VEH_FIRST + VEH_COUNT - 1)
12 /** If you register a new vehicle, make sure to add it to all.inc */
13 #define REGISTER_VEHICLE(id, inst) REGISTER(RegisterVehicles, VEH, vehicle_info, VEH_COUNT, id, vehicleid, inst)
14 #define REGISTER_VEHICLE_SIMPLE(id, vehicleflags, min_s, max_s, modelname, headmodelname, hudmodelname, headtag, hudtag, viewtag, shortname, vname) \
15     REGISTER_VEHICLE(id, NEW(Vehicle)) {    \
16         this.netname = shortname;           \
17         this.vehicle_name = vname;          \
18         this.mdl = modelname;               \
19         this.spawnflags = vehicleflags;     \
20         this.mins = min_s;                  \
21         this.maxs = max_s;                  \
22         this.model = modelname;             \
23         this.head_model = headmodelname;    \
24         this.hud_model = hudmodelname;      \
25         this.tag_head = headtag;            \
26         this.tag_hud = hudtag;              \
27         this.tag_view = viewtag;            \
28     }                                       \
29     REGISTER_INIT(VEH, id)
30 REGISTER_REGISTRY(RegisterVehicles)
31
32 #if defined(SVQC)
33         #include "sv_vehicles.qh"
34 #elif defined(CSQC)
35         #include "cl_vehicles.qh"
36 #endif
37
38 REGISTER_VEHICLE(Null, NEW(Vehicle));
39
40 #include "all.inc"
41
42 #endif