]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret/phaser_weapon.qc
Merge branch 'master' into TimePath/csqc_viewmodels
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / phaser_weapon.qc
index 7d5a967aa70bfe89f52162dd6d95d4e857d30a3a..087ade8d47b2c1e7e23ac18b1e647433eab2a4b9 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;