• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

What does this tigger do

Status
Not open for further replies.
Level 11
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