• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] Calling BlzSetUnitAbilityCooldown crashes the game on cast

Status
Not open for further replies.
Level 12
Joined
Oct 10, 2009
Messages
438
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:
Level 12
Joined
Oct 10, 2009
Messages
438
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...
 
Level 12
Joined
Oct 10, 2009
Messages
438
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.
Top