]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/racer.qc
Weapons: pass weapon index
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / racer.qc
index e9211d54507163f9fd25ba328574e561ce4dcb73..6844efa082b8767321ff45dca41fd1071995a8c3 100644 (file)
@@ -27,7 +27,6 @@ REGISTER_VEHICLE(RACER, NEW(Racer));
 #include "racer_weapon.qc"
 
 #ifdef SVQC
-#include "../../effects/effects.qh"
 #include "../../triggers/trigger/impulse.qh"
 
 bool autocvar_g_vehicle_racer;
@@ -322,7 +321,7 @@ float racer_frame()
                // Fix z-aim (for chase mode)
                crosshair_trace(player);
                w_shotdir.z = normalize(trace_endpos - org).z * 0.5;
-               wep1.wr_think(wep1, self, true, false);
+               wep1.wr_think(wep1, self, 0, 1);
        }
 
        if(autocvar_g_vehicle_racer_rocket_locktarget)
@@ -482,12 +481,13 @@ void racer_blowup()
                                        autocvar_g_vehicle_racer_blowup_edgedamage,
                                        autocvar_g_vehicle_racer_blowup_radius, world, world,
                                        autocvar_g_vehicle_racer_blowup_forceintensity,
-                                       DEATH_VH_WAKI_DEATH, world);
+                                       DEATH_VH_WAKI_DEATH.m_id, world);
 
        self.nextthink  = time + autocvar_g_vehicle_racer_respawntime;
        self.think        = vehicles_spawn;
        self.movetype   = MOVETYPE_NONE;
        self.effects    = EF_NODRAW;
+       self.solid = SOLID_NOT;
 
        self.colormod  = '0 0 0';
        self.avelocity = '0 0 0';
@@ -514,8 +514,8 @@ void racer_deadtouch()
                racer_blowup();
 }
 
-void spawnfunc_vehicle_racer()
-{SELFPARAM();
+spawnfunc(vehicle_racer)
+{
        if(!autocvar_g_vehicle_racer) { remove(self); return; }
        if(!vehicle_initialize(VEH_RACER, false)) { remove(self); return; }
 }
@@ -654,8 +654,11 @@ void racer_draw()
                {
                        Vehicles_drawHUD(VEH_RACER.m_icon, "vehicle_racer_weapon1", "vehicle_racer_weapon2",
                                                         "vehicle_icon_ammo1", autocvar_hud_progressbar_vehicles_ammo1_color,
-                                                        "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color,
-                                                        vCROSS_GUIDE);
+                                                        "vehicle_icon_ammo2", autocvar_hud_progressbar_vehicles_ammo2_color);
+               }
+               METHOD(Racer, vr_crosshair, void(Racer thisveh))
+               {
+                       Vehicles_drawCrosshair(vCROSS_GUIDE);
                }
 #endif
                METHOD(Racer, vr_setup, void(Racer thisveh))