Moderator
M
Moderator
14:18, 19th Aug 2013
PurgeandFire: Overall, the spell looks good. The only problem is in the periodic trigger. You check if the group is empty. It is not advisable to do that with periodic triggers since it'll enumerate the group all over just to check if it is empty. A better way is to have an integer to keep track of the number of units in your group. Every time you add a unit to the group, increase the counter by one. Every time you remove a unit from the group, decrease the counter by one. When the counter is 0 (no units in the group), then turn off the trigger.
Fix that, and it will be approvable!
PurgeandFire: Overall, the spell looks good. The only problem is in the periodic trigger. You check if the group is empty. It is not advisable to do that with periodic triggers since it'll enumerate the group all over just to check if it is empty. A better way is to have an integer to keep track of the number of units in your group. Every time you add a unit to the group, increase the counter by one. Every time you remove a unit from the group, decrease the counter by one. When the counter is 0 (no units in the group), then turn off the trigger.
Fix that, and it will be approvable!