| 32 | |
| 33 | int threadCount = 0; |
| 34 | void UpdateScripts() |
| 35 | { |
| 36 | std::list<aithread>::iterator i = aiThreadList.begin(); |
| 37 | while ( i != aiThreadList.end() ) |
| 38 | { |
| 39 | i->showDebug(0, 0); |
| 40 | if ( !i->sleep() ) // wait/sleep |
| 41 | { |
| 42 | if ( i->getFlags() & AI_THREAD_WANT_KILLED ) |
| 43 | { |
| 44 | i = aiThreadList.erase(i); |
| 45 | --threadCount; |
| 46 | continue; |
| 47 | } |
| 48 | |
| 49 | // execute thread |
| 50 | i->execute(); |
| 51 | } |
| 52 | ++i; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | bool LoadAIBinary(const char *pszFileName) |
| 57 | { |