Results 1 to 2 of 2

Thread: [Bug] RemoveAbility() does not remove passive modifiers attached to the ability

  1. #1
    Basic Member
    Join Date
    Jun 2012
    Posts
    184

    [Bug] RemoveAbility() does not remove passive modifiers attached to the ability

    I imagine that passive modifiers given by an ability should be removed when that ability is removed from a unit. Currently, giving a unit an ability with a passive modifier and then calling RemoveAbility() on that ability will cause the modifier to remain on the unit.

  2. #2
    Basic Member Noya's Avatar
    Join Date
    Dec 2011
    Location
    Uruguay
    Posts
    12,904
    I forgot to report this, I had to deal with this two days ago:

    Code:
    if rank1 then
    	-- Remove any of the modifiers before reapplying
    	unit:RemoveModifierByName("human_forged_swords1")
    	unit:RemoveModifierByName("modifier_bonus_damage")
    	unit:RemoveModifierByName("modifier_knight_damage")
    	unit:RemoveModifierByName("modifier_gryphon_rider_damage")
    
    	unit:AddAbility("human_forged_swords2")
    	unit:SwapAbilities("human_forged_swords1", "human_forged_swords2", false, true)
    	unit:RemoveAbility("human_forged_swords1")
    	local ability = unit:FindAbilityByName("human_forged_swords2")
    	ability:SetLevel(2)

    I think RemoveAbility also has some bugs with the display, sometimes my upgraded skills wouldn't show or disappear until I changed the current selection.
    Added to the list

Posting Permissions

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