]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret/phaser_weapon.qc
Weapons: add a second .weaponentity
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / phaser_weapon.qc
index 8e746049b6a4e8c8d5506bc265bb93375d28b64d..9511d648c373b047dea356554b0c5f865c8a2771 100644 (file)
@@ -22,7 +22,7 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, int slot
 {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
-    if (!isPlayer || weapon_prepareattack(thiswep, actor, false, WEP_CVAR_PRI(electro, refire))) {
+    if (!isPlayer || weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR_PRI(electro, refire))) {
         if (isPlayer) {
             turret_initparams(actor);
             W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
@@ -30,7 +30,7 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, int slot
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
             actor.shot_speed = 1;
-            weapon_thinkf(actor, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
+            weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
         }
         entity beam = spawn();
         beam.ticrate = 0.1; //autocvar_sys_ticrate;
@@ -51,8 +51,8 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, int slot
         sound (beam, CH_SHOTS_SINGLE, SND_TUR_PHASER, VOL_BASE, ATTEN_NORM);
         actor.fireflag = 1;
 
-        beam.attack_finished_single = actor.attack_finished_single;
-        actor.attack_finished_single = time; // + autocvar_sys_ticrate;
+        beam.attack_finished_single[0] = actor.attack_finished_single[0];
+        actor.attack_finished_single[0] = time; // + autocvar_sys_ticrate;
 
         setattachment(beam,actor.tur_head, "tag_fire");
 
@@ -67,7 +67,7 @@ void beam_think()
 {SELFPARAM();
     if ((time > self.cnt) || (self.owner.deadflag != DEAD_NO))
     {
-        self.owner.attack_finished_single = time + self.owner.shot_refire;
+        self.owner.attack_finished_single[0] = time + self.owner.shot_refire;
         self.owner.fireflag = 2;
         self.owner.tur_head.frame = 10;
         sound (self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
@@ -86,7 +86,7 @@ void beam_think()
 
     self.nextthink = time + self.ticrate;
 
-    self.owner.attack_finished_single = time + frametime;
+    self.owner.attack_finished_single[0] = time + frametime;
     setself(self.owner);
     FireImoBeam (   self.tur_shotorg,
                     self.tur_shotorg + self.tur_shotdir_updated * self.target_range,