]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret/phaser_weapon.qc
Merge branch 'master' into terencehill/dynamic_hud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / phaser_weapon.qc
index 7d5a967aa70bfe89f52162dd6d95d4e857d30a3a..a82f949adefe04441a8e44dbde0afddf654bc213 100644 (file)
@@ -17,20 +17,20 @@ REGISTER_WEAPON(PHASER, NEW(PhaserTurretAttack));
 void beam_think();
 
 .int fireflag;
-
-METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
+SOUND(PhaserTurretAttack_FIRE, W_Sound("electro_fire"));
+METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
 {
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
-    if (!isPlayer || weapon_prepareattack(thiswep, actor, slot, false, WEP_CVAR_PRI(electro, refire))) {
+    if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, 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);
+            W_SetupShot_Dir(actor, v_forward, false, 0, SND_PhaserTurretAttack_FIRE, CH_WEAPON_B, 0);
             actor.tur_shotdir_updated = w_shotdir;
             actor.tur_shotorg = w_shotorg;
             actor.tur_head = actor;
             actor.shot_speed = 1;
-            weapon_thinkf(actor, slot, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
+            weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
         }
         entity beam = spawn();
         beam.ticrate = 0.1; //autocvar_sys_ticrate;
@@ -65,7 +65,7 @@ METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, entity actor, int slot
 
 void beam_think()
 {SELFPARAM();
-    if ((time > self.cnt) || (self.owner.deadflag != DEAD_NO))
+    if ((time > self.cnt) || (IS_DEAD(self.owner)))
     {
         self.owner.attack_finished_single[0] = time + self.owner.shot_refire;
         self.owner.fireflag = 2;