# [Crash]I find it odd this crashes war3 xD

Status
Not open for further replies.

#### Kakerate

Level 13
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• SlotTakenBool[TempInt] Equal to False
• Then - Actions
• Set SlotTakenBool[TempInt] = True
• Set Winner[(WinnerNum - 1)] = Finalist[TempInt]
• Destructible - Create a IconsType[(Custom value of Winner[(WinnerNum - 1)])] at UIWinPoint[TempInt] facing 180.00 with scale 1.00 and variation 0
• Else - Actions
• Trigger - Run (This trigger) (checking conditions)

Alright so this piece of script crashes War3, idk if it is just for me, but I don't think so. xD I'm assuming its the "Trigger - Run (This trigger) (checking conditions)" Kinda makes me wonder why there is even a Function for "This Trigger" xD Ah well. Is a "For Each Integer" action the most efficient way to do the same thing?

#### Wietlol

Level 24
You make an infinite loop

Lets say your int is 1 and SlotTaken[1] = true

Then it is infinitely looping.

#### Kakerate

Level 13
For some reason, it didn't copy the action above that if/then
the action above is:
set tempint= random int (1,10) So it doesn't seem it would cause an infinite loop, correct? As it would run the trigger again and generate a different integer.

Last edited:

#### Dr Super Good

Spell Reviewer
Level 63
So it doesn't seem it would cause an infinite loop, correct?
It still could due to the random nature of random numbers. Obviously it becomes practically impossible but still could happen.

The crash is likely due to recursive nonsense. Anything from stack overflow to JASS not being able to handle the state. It could even be one of the other actions crashing in the case of it creating an invalid destructible.

I would recommend making an array list. You can then pick one index at random (0 to size-1) and remove it from the list repeating until the list is empty. This guarantees that each iteration will give you a SlotTakenBool Equal to False element. Not recursive and finite iteration length solve everything.

hdm

#### Kakerate

Level 13
@Dr. Super Good
Ah, that's exactly the kind of answer I was looking for ^^ Thanks. I singled out everything in my trigger and found out it was that "Run (This trigger)" bit. Thanks for the suggestion as well, that would seem the best way to do it.

Status
Not open for further replies.

Replies
8
Views
637
Replies
2
Views
412
Replies
1
Views
564
Replies
6
Views
624
Replies
24
Views
803