]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/t_items.qc
Merge branch 'master' into Mario/use1
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / t_items.qc
index 87623da3630d62f7a98e1e20bea14cbf960accf6..2c1b2a8ddae23bca2b08d410db17196863afe040 100644 (file)
@@ -1421,29 +1421,31 @@ spawnfunc(item_invincible)
 // compatibility:
 spawnfunc(item_quad) { this.classname = "item_strength";spawnfunc_item_strength(this);}
 
-void target_items_use()
-{SELFPARAM();
-       if(activator.classname == "droppedweapon")
+void target_items_use(entity this, entity actor, entity trigger)
+{
+       other = trigger; // TODO
+
+       if(actor.classname == "droppedweapon")
        {
                EXACTTRIGGER_TOUCH;
-               remove(activator);
+               remove(actor);
                return;
        }
 
-       if (!IS_PLAYER(activator))
+       if (!IS_PLAYER(actor))
                return;
-       if(IS_DEAD(activator))
+       if(IS_DEAD(actor))
                return;
        EXACTTRIGGER_TOUCH;
 
-       FOREACH_ENTITY_ENT(enemy, activator,
+       FOREACH_ENTITY_ENT(enemy, actor,
        {
                if(it.classname == "droppedweapon")
                        remove(it);
        });
 
-       if(GiveItems(activator, 0, tokenize_console(self.netname)))
-               centerprint(activator, self.message);
+       if(GiveItems(actor, 0, tokenize_console(this.netname)))
+               centerprint(actor, this.message);
 }
 
 spawnfunc(target_items)
@@ -1451,7 +1453,7 @@ spawnfunc(target_items)
        float n, i;
        string s;
 
-       self.use = target_items_use;
+       self.use1 = target_items_use;
        if(!self.strength_finished)
                self.strength_finished = autocvar_g_balance_powerup_strength_time;
        if(!self.invincible_finished)