• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] GUI Spell System - Deindexing Twice

Status
Not open for further replies.
Level 19
Joined
Oct 17, 2012
Messages
859
The system would deindex an instance of my spell, even though I assigned a new Spell__Time.

This issue does not occur in sample spell "Dipper"

Test Map

JASS:
/*Function below (which is a part of the system) runs along with GT_Finish*/ 
function SpellTimerLoop takes nothing returns nothing
    local integer i = udg_Spell_i_StackN
    local integer node
    local real time
    set udg_Spell__Running = true
    
    //Run stack top to bottom to avoid skipping slots when destroying.
    loop
        set i = i - 1
        exitwhen i < 0
        set node = udg_Spell_i_Stack[i]
        set time = udg_Spell_i_Time[node] - udg_Spell__Interval
        if time <= 0.00 then
            set time = SpellTriggerExecute(node, udg_Spell_i_OnLoopStack[node])
        endif
/* The following if-then should return false since I specified a new Spell__Time*/
/* time should be set to the new Spell__Time in the last If-then */
        if time <= 0.00 then
        call BJDebugMsg("Deindexing")
            call SpellIndexDestroy(node)
        else
            set udg_Spell_i_Time[node] = time
        endif
    endloop
    set udg_Spell__Running = false
endfunction
  • GT Finish
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Spell__Completed Equal to True
        • Then - Actions
          • Special Effect - Create a special effect attached to the weapon of Spell__Caster using Abilities\Weapons\DragonHawkMissile\DragonHawkMissile.mdl
          • Set GT_EnchantedSfx[(Custom value of Spell__Caster)] = (Last created special effect)
          • Set GT_RefInt[(Custom value of Spell__Caster)] = Spell__Index
        • Else - Actions
      • Set Spell__Time = 3.00
      • Set Spell__Trigger_OnLoop = Untitled Trigger 003 <gen>
      • Set RF__Player = Spell__CasterOwner
      • Trigger - Run RF System <gen> (ignoring conditions)
 
Status
Not open for further replies.
Top