Jump to content
Sign in to follow this  
roguetrooper

What's wrong with this forEach-code?

Recommended Posts

The player is west.

I want all east units to join an east general.

But this code also joins the player into the general's group :confused:

_exclude = [general, dummy];

{ if ( (side _x == EAST) and !(_x in _exclude) ) then ([_x] joinSilent general) } forEach allunits;

Meanwhile I found another method that works. But just for couriosity, why does the code above also joins west units into the general's group?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×