]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/instagib/instagib.qc
Purge self from the damage/death mutator hooks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / instagib / instagib.qc
index fa8ce973477430f05415cc5e750a2293fa810232..34836ab3d4e40327dc5ea773c23f5c46de56f78c 100644 (file)
@@ -145,7 +145,9 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, MatchEnd)
 
 MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterDropItem)
 {
-       other.monster_loot = spawnfunc_item_minst_cells;
+       entity item = M_ARGV(1, entity);
+
+       item.monster_loot = spawnfunc_item_minst_cells;
 
        return false;
 }
@@ -253,10 +255,8 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerPhysics)
 
 MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDamage_SplitHealthArmor)
 {
-       damage_save = 0;
-       damage_take = frag_damage;
-
-       return false;
+       M_ARGV(4, float) = M_ARGV(7, float); // take = damage
+       M_ARGV(5, float) = 0; // save
 }
 
 MUTATOR_HOOKFUNCTION(mutator_instagib, ForbidThrowCurrentWeapon)
@@ -423,6 +423,9 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, CustomizeWaypoint)
 
 MUTATOR_HOOKFUNCTION(mutator_instagib, PlayerDies)
 {
+       float frag_deathtype = M_ARGV(3, float);
+       float frag_damage = M_ARGV(4, float);
+
        if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER))
                frag_damage = 1000; // always gib if it was a vaporizer death