]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/devastator.qc
Fix sticky electro orbs and mines being unhittable on DP master
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / devastator.qc
index 089002714dcf6af0e66638f436b4097543f30c86..6f428dc6c413430cb52440659da1c3a5eac6e6b5 100644 (file)
@@ -378,9 +378,11 @@ METHOD(Devastator, wr_aim, void(entity thiswep, entity actor, .entity weaponenti
     float spd = WEP_CVAR(devastator, speed);
     // simulate rocket guide by calculating rocket trajectory with higher speed
     // 20 times faster at 90 degrees guide rate
-    if (actor.bot_aimtarg && WEP_CVAR(devastator, guiderate) > 0)
+    if (WEP_CVAR(devastator, guiderate) > 0)
         spd *= sqrt(WEP_CVAR(devastator, guiderate)) * (20 / 9.489); // 9.489 ~= sqrt(90)
-    PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, spd, 0, WEP_CVAR(devastator, lifetime), false);
+    // no need to fire with high accuracy on large distances if rockets can be guided
+    bool shot_accurate = (WEP_CVAR(devastator, guiderate) < 50);
+    PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, spd, 0, WEP_CVAR(devastator, lifetime), false, shot_accurate);
     float pred_time = bound(0.02, 0.02 + (8 - skill) * 0.01, 0.1);
     if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
     {
@@ -584,8 +586,7 @@ METHOD(Devastator, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Devastator, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 12;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
         sound(actor, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM);