]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/compat/quake3.qc
Merge branch 'master' into bones_was_here/q3compat
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / compat / quake3.qc
index 71a11b6305acf60308cec6235aad6cdca5109ed2..264daeca1a9306277cd2b6f333be4039fd12c55a 100644 (file)
@@ -7,6 +7,7 @@
 #include <server/items/items.qh>
 #include <server/items/spawning.qh>
 #include <server/resources.qh>
+#include <server/world.qh>
 #include <common/gamemodes/_mod.qh>
 #include <common/gamemodes/gamemode/ctf/sv_ctf.qh>
 #include <common/mapobjects/triggers.qh>
@@ -19,8 +20,9 @@
  ***********************
 
  * Map entities NOT handled in this file:
- holdable_invulnerability      Q3TA    currently unsupported
- holdable_kamikaze             Q3TA    currently unsupported
+ holdable_invulnerability      Q3TA    buffs mutator
+ holdable_kamikaze             Q3TA    buffs mutator
+ holdable_teleporter           Q3A     buffs mutator
  item_ammoregen                        Q3TA    buffs mutator
  item_doubler                  Q3TA    buffs mutator
  item_guard                    Q3TA    buffs mutator
@@ -77,6 +79,7 @@ SPAWNFUNC_Q3(weapon_railgun, ammo_slugs, WEP_VORTEX)
 
 // BFG -> Crylink || Fireball
 SPAWNFUNC_Q3_COND(weapon_bfg, ammo_bfg, cvar_string("g_mod_balance") == "XDF", WEP_CRYLINK, WEP_FIREBALL)
+       // FIXME: WEP_FIREBALL has no ammo_type field so ammo_bfg is deleted by spawnfunc_body
 
 // grappling hook -> hook
 SPAWNFUNC_WEAPON(weapon_grapplinghook, WEP_HOOK)
@@ -201,26 +204,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);
                }