]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow changing other/toucher from item and buff touch mutator hooks
authorMario <mario@smbclan.net>
Fri, 10 Jun 2016 16:32:50 +0000 (02:32 +1000)
committerMario <mario@smbclan.net>
Fri, 10 Jun 2016 16:32:50 +0000 (02:32 +1000)
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/t_items.qc
qcsrc/server/cl_client.qc
qcsrc/server/mutators/events.qh

index e2cb8b3181d3e8783939f46bd99e2b7f6169b653..b89871c8423bf27ad64caaa62953ea08340e7db4 100644 (file)
@@ -244,6 +244,7 @@ void buff_Touch(entity this)
 
        if(MUTATOR_CALLHOOK(BuffTouch, this, other))
                return;
+       other = M_ARGV(1, entity);
 
        if(!IS_PLAYER(other))
                return; // incase mutator changed other
index 8967fba42d3ce6f45b3a08bfc372f5582a7bd350..0829464d22fb763e0d93b1146f11bb8fbb84c467 100644 (file)
@@ -785,9 +785,11 @@ void Item_Touch(entity this)
        switch (MUTATOR_CALLHOOK(ItemTouch, this, other))
        {
                case MUT_ITEMTOUCH_RETURN: { return; }
-               case MUT_ITEMTOUCH_PICKUP: { goto pickup; }
+               case MUT_ITEMTOUCH_PICKUP: { other = M_ARGV(1, entity); goto pickup; }
        }
 
+       other = M_ARGV(1, entity);
+
        if (this.classname == "droppedweapon")
        {
                this.strength_finished = max(0, this.strength_finished - time);
index 826af04b1bbb81de98a10d6fc9a1fa23608e64a2..dd5781984cdce19b130b5118c2e88db35a88e8d9 100644 (file)
@@ -383,7 +383,7 @@ void FixPlayermodel(entity player)
                        defaultskin = autocvar_sv_defaultplayerskin;
        }
 
-       MUTATOR_CALLHOOK(FixPlayermodel, defaultmodel, defaultskin);
+       MUTATOR_CALLHOOK(FixPlayermodel, defaultmodel, defaultskin, player);
        defaultmodel = M_ARGV(0, string);
        defaultskin = M_ARGV(1, int);
 
index 7f3406bf437bbdb025e8fdb802ef22fe673f6f1a..4c25477c374936ee19d1fdfb7d20e8b7d7f61c2f 100644 (file)
@@ -545,6 +545,7 @@ MUTATOR_HOOKABLE(AbortSpeedrun, EV_AbortSpeedrun);
 #define EV_ItemTouch(i, o) \
     /** item */    i(entity, MUTATOR_ARGV_0_entity) \
     /** toucher */ i(entity, MUTATOR_ARGV_1_entity) \
+    /**/           o(entity, MUTATOR_ARGV_1_entity) \
     /**/
 MUTATOR_HOOKABLE(ItemTouch, EV_ItemTouch);
 
@@ -631,6 +632,7 @@ MUTATOR_HOOKABLE(BuffModel_Customize, EV_BuffModel_Customize);
 #define EV_BuffTouch(i, o) \
     /** buff */    i(entity, MUTATOR_ARGV_0_entity) \
     /** player */  i(entity, MUTATOR_ARGV_1_entity) \
+    /**/           o(entity, MUTATOR_ARGV_1_entity) \
     /**/
 MUTATOR_HOOKABLE(BuffTouch, EV_BuffTouch);