]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Player templates: Added support for InstaGib.
authorLyberta <lyberta@lyberta.net>
Thu, 1 Jun 2017 12:01:48 +0000 (15:01 +0300)
committerLyberta <lyberta@lyberta.net>
Thu, 1 Jun 2017 12:01:48 +0000 (15:01 +0300)
qcsrc/common/mutators/mutator/playertemplates/sv_playertemplates.qc

index b8142494f890432d65b890ec5216d5e97779ca80..c3a742b5700015dc2ba10544624a12b4c79085d5 100644 (file)
@@ -244,6 +244,10 @@ void PlayerTemplate_PlayerSpawn(entity player, string template)
                player.ammo_cells = PlayerTemplate_GetFloatValue(template,
                        "start_ammo_cells");
        }
+       if (autocvar_g_instagib == 1)
+       {
+               return;
+       }
        // Give weapons.
        if (PlayerTemplate_GetFloatValue(template, "default_start_weapons"))
        {
@@ -987,6 +991,10 @@ float PlayerTemplate_ItemTouch(entity player, entity item, string template)
 float PlayerTemplate_Damage_Calculate(entity attacker, string attackertemplate,
        entity victim, string victimtemplate, float deathtype, float damage)
 {
+       if (autocvar_g_instagib == 1)
+       {
+               return damage;
+       }
        if ((attacker == victim) && (DEATH_ISWEAPON(deathtype, WEP_BLASTER)) &&
                (PlayerTemplate_GetFloatValue(victimtemplate, "blaster_self_damage") ==
                0))