]> icculus.org git repositories - divverent/nexuiz.git/blob - data/source/control/automation/foreach.qc
give menu source its own directory
[divverent/nexuiz.git] / data / source / control / automation / foreach.qc
1 // DP/Nex Menu
2 // control/automation/foreach.qc
3
4 void() Item_Automation_ForEach_Spawn =
5 {
6         local entity lLink;
7
8         Item_Automation_Init();
9
10         if( self.link == "" )
11                 lLink = self._parent;
12         else
13                 lLink = Menu_GetItem( self.link );
14         if( !self.target || !isfunction( strcat( self.target, "_Spawn" ) ) ) {
15                 objerror( "Bad target type!" );
16                 return;
17         }
18
19         for( self._current = lLink._child ; self._current ; self._current = self._current._next )
20                 if( self._current.type == self.target )
21                         CtCall_Action();
22 };
23