]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/devastator.qc
Fix unregistering of rockets (player doesn't have lastrocket assigned to them anymore)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / devastator.qc
index 7bae89368b3ec992524b61c2aa78f01eaeec6d70..f22f0cedc6bc484378d84421f8e8c83342228d18 100644 (file)
@@ -4,7 +4,7 @@ CLASS(Devastator, Weapon)
 /* ammotype  */ ATTRIB(Devastator, ammo_field, .int, ammo_rockets);
 /* impulse   */ ATTRIB(Devastator, impulse, int, 9);
 /* flags     */ ATTRIB(Devastator, spawnflags, int, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(Devastator, bot_pickupbasevalue, float, BOT_PICKUP_RATING_HIGH);
+/* rating    */ ATTRIB(Devastator, bot_pickupbasevalue, float, 8000);
 /* color     */ ATTRIB(Devastator, wpcolor, vector, '1 1 0');
 /* modelname */ ATTRIB(Devastator, mdl, string, "rl");
 #ifdef GAMEQC
@@ -76,15 +76,11 @@ spawnfunc(weapon_rocketlauncher) { spawnfunc_weapon_devastator(this); }
 
 void W_Devastator_Unregister(entity this)
 {
-       if(this.realowner && this.realowner.lastrocket == this)
+       for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
        {
-               for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
-               {
-                       .entity weaponentity = weaponentities[slot];
-                       if(this.realowner.(weaponentity).lastrocket == this)
-                               this.realowner.(weaponentity).lastrocket = NULL;
-               }
-               // this.realowner.rl_release = 1;
+               .entity weaponentity = weaponentities[slot];
+               if(this.realowner.(weaponentity).lastrocket == this)
+                       this.realowner.(weaponentity).lastrocket = NULL;
        }
 }
 
@@ -390,6 +386,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        missile.health = WEP_CVAR(devastator, health);
        missile.event_damage = W_Devastator_Damage;
        missile.damagedbycontents = true;
+       IL_PUSH(g_damagedbycontents, missile);
 
        set_movetype(missile, MOVETYPE_FLY);
        PROJECTILE_MAKETRIGGER(missile);