]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
Merge branch 'master' into martin-t/mg-solidpen
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / spiderbot_weapons.qc
index 1fde99b3fcc48e87014fa84f57e1d1a0d11bd9b2..308a92fd87871bbe4972d441ef56ea40cd6ae0d1 100644 (file)
@@ -1,7 +1,5 @@
 #include "spiderbot_weapons.qh"
 
-#ifdef IMPLEMENTATION
-
 #ifdef SVQC
 
 void spiderbot_rocket_artillery(entity this)
@@ -143,7 +141,7 @@ void spiderbot_rocket_do(entity this)
 
     if (this.wait != -10)
     {
-        if (PHYS_INPUT_BUTTON_ATCK2(this.owner) && this.vehicle_weapon2mode == SBRM_GUIDE)
+        if (PHYS_INPUT_BUTTON_ATCK2(this.owner) && STAT(VEHICLESTAT_W2MODE, this) == SBRM_GUIDE)
         {
             if (this.wait == 1)
             if (this.tur_head.frame == 9 || this.tur_head.frame == 1)
@@ -177,12 +175,12 @@ void spiderbot_rocket_do(entity this)
     if(!PHYS_INPUT_BUTTON_ATCK2(this.owner))
         return;
 
-    if(forbidWeaponUse(this.owner))
+    if(weaponLocked(this.owner) || weaponUseForbidden(this.owner))
         return;
 
     v = gettaginfo(this.tur_head,gettagindex(this.tur_head,"tag_fire"));
 
-    switch(this.vehicle_weapon2mode)
+    switch(STAT(VEHICLESTAT_W2MODE, this))
     {
         case SBRM_VOLLY:
             rocket = vehicles_projectile(this, EFFECT_SPIDERBOT_ROCKETLAUNCH.eent_eff_name, SND_ROCKET_FIRE,
@@ -242,11 +240,9 @@ void spiderbot_rocket_do(entity this)
     if (this.tur_head.frame == 9)
         this.attack_finished_single[0] = autocvar_g_vehicle_spiderbot_rocket_reload;
     else
-        this.attack_finished_single[0] = ((this.vehicle_weapon2mode ==  SBRM_VOLLY) ? autocvar_g_vehicle_spiderbot_rocket_refire2 : autocvar_g_vehicle_spiderbot_rocket_refire);
+        this.attack_finished_single[0] = ((STAT(VEHICLESTAT_W2MODE, this) ==  SBRM_VOLLY) ? autocvar_g_vehicle_spiderbot_rocket_refire2 : autocvar_g_vehicle_spiderbot_rocket_refire);
 
     this.gun2.cnt = time + this.attack_finished_single[0];
 }
 
 #endif
-
-#endif