]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
URS: Ported Blood loss mutator to URS.
authorLyberta <lyberta@lyberta.net>
Mon, 28 Aug 2017 22:05:31 +0000 (01:05 +0300)
committerLyberta <lyberta@lyberta.net>
Mon, 28 Aug 2017 22:05:31 +0000 (01:05 +0300)
qcsrc/common/mutators/mutator/bloodloss/sv_bloodloss.qc

index 61b0c06016923ad311c1d03e15a9adaf2852fe42..d1b2658161ccc9c0741ba26ba5a4c01bd18e33ff 100644 (file)
@@ -9,7 +9,7 @@ MUTATOR_HOOKFUNCTION(bloodloss, PlayerPreThink)
        entity player = M_ARGV(0, entity);
 
        if(IS_PLAYER(player))
-       if(player.health <= autocvar_g_bloodloss && !IS_DEAD(player))
+       if(GetResourceAmount(player, RESOURCE_HEALTH) <= autocvar_g_bloodloss && !IS_DEAD(player))
        {
                PHYS_INPUT_BUTTON_CROUCH(player) = true;
 
@@ -28,7 +28,7 @@ MUTATOR_HOOKFUNCTION(bloodloss, PlayerJump)
 {
        entity player = M_ARGV(0, entity);
 
-       if(player.health <= autocvar_g_bloodloss)
+       if(GetResourceAmount(player, RESOURCE_HEALTH) <= autocvar_g_bloodloss)
                return true;
 }