Results 1 to 1 of 1

Thread: [BUG] ApplyDamage() 'damage_flags' field ignored when 'ability' field exists.

  1. #1
    Basic Member KreeG's Avatar
    Join Date
    Jan 2014
    Posts
    25

    Exclamation [BUG] ApplyDamage() 'damage_flags' field ignored when 'ability' field exists.

    When "ability" field isn't nil "damage_flags" field is ignored.

    Example code:
    1. Without 'ability' field:
    Code:
    	local hero = HeroList:GetHero(0)
    	local damage = {
    		victim = hero,
    		attacker = hero,
    		damage = 10000,
    		damage_type = DAMAGE_TYPE_MAGICAL,
    		damage_flags = DOTA_DAMAGE_FLAG_NON_LETHAL,
    	}
    	ApplyDamage(damage)
    Works as intended - hero HP has decreased to 1.

    2. With 'ability' field:
    Code:
    	local hero = HeroList:GetHero(0)
    	local damage = {
    		victim = hero,
    		attacker = hero,
    		damage = 10000,
    		damage_type = DAMAGE_TYPE_MAGICAL,
    		damage_flags = DOTA_DAMAGE_FLAG_NON_LETHAL,
    		ability = hero:GetAbilityByIndex(0),
    	}
    	ApplyDamage(damage)
    Hero gets denied.

    Edit:
    Whoops, DamageFilter was the reason, but there's no way to fix this, we can't check flags of damage...
    Last edited by KreeG; 02-27-2017 at 03:27 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •