[JASS] Calling BlzSetUnitAbilityCooldown crashes the game on cast

Status
Not open for further replies.
Level 13
Joined
Oct 10, 2009
Messages
439
Hey guys!

So, I'm using a spell based off of 'Chemical Rage' - I'm using Jass to reduce the cooldown of this ability forever by 1 second. The problem is that it crashes the game when I cast it next. Got any ideas?

JASS:
            // Reduce the cooldown of the ultimate ability
            set levelOfAbility = GetUnitAbilityLevel(this.target, SPELL_E_ID)
            set cooldown = BlzGetUnitAbilityCooldown(this.target, SPELL_E_ID, levelOfAbility)
          
            if cooldown - this.getCooldownReduction() > 1 then
                call BlzSetUnitAbilityCooldown(this.target, SPELL_E_ID, levelOfAbility, cooldown - this.getCooldownReduction())
            else
                call BlzSetUnitAbilityCooldown(this.target, SPELL_E_ID, levelOfAbility, 1)
            endif
 
Last edited by a moderator:
The cooldown is definitely being set correctly. I'm seeing it being reduced (By logging the cooldown via BlzGetCooldownRemaining) go from 200.00 -> 199.00 -> 198.00 etc.

But the moment the ability is cast and the cooldown has been altered at all, the map crashes.

hmm...
 
which event amre you using for that trigger? If you are using spell cast event, try using the starts-effect equivalent instead--maybe setting the cooldown at that time is bugging out the engine.

You can also try doing a 0 second timer before setting the cooldown and see if that fixes the crash.

It's called from a periodic timer, when <this> custom missile enters within 50 units of the target.

There's no crash on other abilities, maybe its *just* Chemical Rage that's broken
 
Last edited:
Status
Not open for further replies.
Back
Top