AceLegend90
New Member
- Reaction score
- 6
As the title states, can a global variable ever be used in two instantaneous triggers at the same time?
For example, I often use a global variable 'tempUnit' and set it to the caster of a certain spell and use 'tempUnit' in another function that checks if a unit is an enemy or not in a 'GroupEnumUnitsInRange' call. My question is, if two spells are initiated, is there ever a chance that the setting of 'tempUnit' happen to be executed one after the other, therefore overriding one spell's effectiveness?
If so, I plan on using a private global variable in each spell that uses 'tempUnit'.
EDIT: This question is more about vJASS. Look at my second comment to try to understand what I'm asking. I'm asking if an entire function's code guaranteed to execute before another function's.
For example, I often use a global variable 'tempUnit' and set it to the caster of a certain spell and use 'tempUnit' in another function that checks if a unit is an enemy or not in a 'GroupEnumUnitsInRange' call. My question is, if two spells are initiated, is there ever a chance that the setting of 'tempUnit' happen to be executed one after the other, therefore overriding one spell's effectiveness?
If so, I plan on using a private global variable in each spell that uses 'tempUnit'.
EDIT: This question is more about vJASS. Look at my second comment to try to understand what I'm asking. I'm asking if an entire function's code guaranteed to execute before another function's.