Dirac
22710180
- Reaction score
- 147
I need to know if a unit within the range of another unit dies, so what's best?
-Checking periodically if around the main unit are there any dead units
Pros
Ignores any unit that dies outside range
Cons
Uses timers
-Create a trigger that detonates every time a unit dies and then check if that unit is nearby the main unit
Pros
Doesn't use timers
Cons
Leaks triggers conditions and actions
Checks all units in the map even when there's no need
NOTE: for every dead unit i create a timer, so consider that registering unnecessary unis affects efficiency
-Checking periodically if around the main unit are there any dead units
Pros
Ignores any unit that dies outside range
Cons
Uses timers
-Create a trigger that detonates every time a unit dies and then check if that unit is nearby the main unit
Pros
Doesn't use timers
Cons
Leaks triggers conditions and actions
Checks all units in the map even when there's no need
NOTE: for every dead unit i create a timer, so consider that registering unnecessary unis affects efficiency