| 207 | |
| 208 | static int do_lookup[256]; |
| 209 | void BaseMenuStyle::ProcessWatchList() |
| 210 | { |
| 211 | if (!m_WatchList.size()) |
| 212 | { |
| 213 | return; |
| 214 | } |
| 215 | |
| 216 | #if defined MENU_DEBUG |
| 217 | logger->LogMessage("BaseMenuStyle::ProcessWatchList(%d,%d,%d,%d,%d,%p)", |
| 218 | m_WatchList.m_Size, |
| 219 | m_WatchList.m_FirstLink, |
| 220 | m_WatchList.m_FreeNodes, |
| 221 | m_WatchList.m_LastLink, |
| 222 | m_WatchList.m_MaxSize, |
| 223 | m_WatchList.m_Nodes); |
| 224 | #endif |
| 225 | |
| 226 | unsigned int total = 0; |
| 227 | for (FastLink<int>::iterator iter=m_WatchList.begin(); iter!=m_WatchList.end(); ++iter) |
| 228 | { |
| 229 | do_lookup[total++] = (*iter); |
| 230 | } |
| 231 | |
| 232 | #if defined MENU_DEBUG |
| 233 | if (total) |
| 234 | { |
| 235 | logger->LogMessage("[SM_MENU] ProcessWatchList() found %d clients", total); |
| 236 | } |
| 237 | #endif |
| 238 | |
| 239 | int client; |
| 240 | CBaseMenuPlayer *player; |
| 241 | float curTime = gpGlobals->curtime; |
| 242 | for (unsigned int i=0; i<total; i++) |
| 243 | { |
| 244 | client = do_lookup[i]; |
| 245 | player = GetMenuPlayer(client); |
| 246 | #if defined MENU_DEBUG |
| 247 | logger->LogMessage("[SM_MENU] ProcessWatchList() (client %d) (bInMenu %d) (menuHoldTime %d) (curTime %f) (menuStartTime %f)", |
| 248 | client, |
| 249 | player->bInMenu, |
| 250 | player->menuHoldTime, |
| 251 | curTime, |
| 252 | player->menuStartTime); |
| 253 | #endif |
| 254 | if (!player->bInMenu || !player->menuHoldTime) |
| 255 | { |
| 256 | #if defined MENU_DEBUG |
| 257 | logger->LogMessage("[SM_MENU] ProcessWatchList() removing client %d", client); |
| 258 | #endif |
| 259 | m_WatchList.remove(client); |
| 260 | continue; |
| 261 | } |
| 262 | if (curTime > player->menuStartTime + player->menuHoldTime) |
| 263 | { |
| 264 | _CancelClientMenu(client, MenuCancel_Timeout, false); |
| 265 | } |
| 266 | } |
no test coverage detected