• 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.

What does this tigger do

Status
Not open for further replies.
Level 12
Joined
Jul 17, 2013
Messages
544
hi i found in my map jass tigger im just wondering if it can be repsonsible for crash i totaly dont know jass tigger si only know gui this jass looks like this
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

shouldi remove this? what does it do can it be responsible for eror
 
Level 13
Joined
May 10, 2009
Messages
868
Well, just declaring that function won't do any harm. However, it depends on how it's being used in your triggers. It could possibly freeze your game if you do something like this
JASS:
call CreateUnitsInRectRandom(Player(0), 'hpea', bj_mapInitialPlayableArea, -1)
That -1 parameter would lead to an infinite loop, because that function doesn't take negative numbers into consideration.[/code]
 
Status
Not open for further replies.
Top