]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
target_give: support multiple targets that give the same resource, and support all...
authorbones_was_here <bones_was_here@xa.org.au>
Fri, 28 Aug 2020 02:40:47 +0000 (12:40 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Fri, 28 Aug 2020 02:40:47 +0000 (12:40 +1000)
qcsrc/server/compat/quake3.qc

index 71a11b6305acf60308cec6235aad6cdca5109ed2..719d383087cc983ac58ccd950214b129d3b68fa9 100644 (file)
@@ -201,26 +201,26 @@ void target_give_init(entity this)
                {
                        entity buff = buff_FirstFromFlags(STAT(BUFFS, it));
                        this.netname = cons(this.netname, buff.netname);
-                       STAT(BUFF_TIME, this) = it.count;
+                       STAT(BUFF_TIME, this) += it.count;
                }
                else
                {
                        if (it.ammo_rockets)
-                               this.ammo_rockets = it.ammo_rockets;
+                               this.ammo_rockets += it.ammo_rockets;
                        else if (it.ammo_cells)
-                               this.ammo_cells = it.ammo_cells;
+                               this.ammo_cells += it.ammo_cells;
                        else if (it.ammo_shells)
-                               this.ammo_shells = it.ammo_shells;
+                               this.ammo_shells += it.ammo_shells;
                        else if (it.ammo_nails)
-                               this.ammo_nails = it.ammo_nails;
+                               this.ammo_nails += it.ammo_nails;
                        else if (it.invincible_finished)
-                               this.invincible_finished = it.invincible_finished;
+                               this.invincible_finished += it.invincible_finished;
                        else if (it.strength_finished)
-                               this.strength_finished = it.strength_finished;
-                       else if (it.classname == "item_armor_mega")
-                               SetResourceExplicit(this, RES_ARMOR, 100);
-                       else if (it.classname == "item_health_mega")
-                               SetResourceExplicit(this, RES_HEALTH, 200);
+                               this.strength_finished += it.strength_finished;
+                       else if (it.health)
+                               this.health += it.health;
+                       else if (it.armorvalue)
+                               this.armorvalue += it.armorvalue;
 
                        this.netname = cons(this.netname, it.netname);
                }