• 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] Does this trigger leak also is it fine can it make crash?

Status
Not open for further replies.
Level 12
Joined
Jul 17, 2013
Messages
544
Hi i have two question frist is whats that function and what does it do? i found it in my map idk if me did it by mistake or my friendfunction CreateUnitsInRectRandom takes player id, integer unitid, rect whichRect, integer number returns nothing
local integer i = 0
loop
exitwhen i == number
call CreateUnit(id, unitid,GetRandomReal(GetRectMinX(whichRect), GetRectMaxX(whichRect)), GetRandomReal(GetRectMinY(whichRect), GetRectMaxY(whichRect)), GetRandomDirectionDeg())
set i = i + 1
endloop
endfunction
my second question is are those triggers fine? do they leak

  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Give Tribute (hotkey y)
      • (Unit-type of (Target unit of ability being cast)) Equal to TradePort
    • Actions
      • Unit - Remove (Triggering unit) from the game
      • Player - Add 600 to (Owner of (Target unit of ability being cast)) Current gold




  • Untitled Trigger 002 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Give gold (hotkey y)
      • (Unit-type of (Target unit of ability being cast)) Equal to TradeCenter
    • Actions
      • Unit - Remove (Triggering unit) from the game
      • Player - Add 500 to (Owner of (Target unit of ability being cast)) Current gold
 
JASS:
function CreateUnitsInRectRandom takes player id, integer unitid, rect whichRect, integer number returns nothing
    local integer i = 0
    loop
        exitwhen i == number
        call CreateUnit(id, unitid,GetRandomReal(GetRectMinX(whichRect), GetRectMaxX(whichRect)), GetRandomReal(GetRectMinY(whichRect), GetRectMaxY(whichRect)), GetRandomDirectionDeg())
        set i = i + 1
    endloop
endfunction

This doesn't seem leaky or suspicious to me, except when intercepting the creation of the units, or obtaining the group.
I agree with @Chaosy, both of these triggers are fine.

should i remove it?
No, it's fine.​

Perhaps you could post the map you're working on. That could help us identify the problem.
 
Status
Not open for further replies.
Top