Dummycaster isn't MUI?!?

hoeyad

New Member
Reaction score
3
This trigger is run whenever a certain spell is cast.
JASS:
function Trig_Frag_Grenade_Copy_Actions takes nothing returns nothing
    local location Temp_Point = GetSpellTargetLoc()
    local unit dummy

    call TriggerSleepAction( 2 )

    call DisplayTextToForce( GetPlayersAll(), R2S(GetLocationX(Temp_Point)) )
    set dummy = CreateUnitAtLoc( GetOwningPlayer(GetSpellAbilityUnit()), 'n002', Temp_Point, 0.0 )
    call IssueImmediateOrder( dummy, "thunderclap" )
    call UnitApplyTimedLife( dummy, 'BTLF', 5.00)
endfunction


It works fine, unless I spam the spell several times within 2 seconds. Then, the dummycaster is only created once at the first place I clicked and not at the rest! However, the text that I put in to debug it appears for each instance that the spell is cast, so I know that the trigger runs every time. I'm a JASS noobzor, but it seems like this should be MUI! Why isn't it?
 

Builder Bob

Live free or don't
Reaction score
249
GetSpellAbilityUnit() should probably also be put in a variable before the sleep. Just a guess as I very rarely use TriggerSleepAction() myself.
 

Tom Jones

N/A
Reaction score
437
Change GetSpellAbilityUnit() to GetTriggerUnit(). Both will return the same unit, however the latter is safer and the first wont survive more than a 1 second wait.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top