| 325 | } |
| 326 | |
| 327 | EventInfo *EventManager::CreateEvent(IPluginContext *pContext, const char *name, bool force) |
| 328 | { |
| 329 | EventInfo *pInfo; |
| 330 | IGameEvent *pEvent = gameevents->CreateEvent(name, force); |
| 331 | |
| 332 | if (pEvent) |
| 333 | { |
| 334 | if (m_FreeEvents.empty()) |
| 335 | { |
| 336 | pInfo = new EventInfo(); |
| 337 | } else { |
| 338 | pInfo = m_FreeEvents.front(); |
| 339 | m_FreeEvents.pop(); |
| 340 | } |
| 341 | |
| 342 | |
| 343 | pInfo->pEvent = pEvent; |
| 344 | pInfo->pOwner = pContext->GetIdentity(); |
| 345 | pInfo->bDontBroadcast = false; |
| 346 | |
| 347 | return pInfo; |
| 348 | } |
| 349 | |
| 350 | return NULL; |
| 351 | } |
| 352 | |
| 353 | void EventManager::FireEvent(EventInfo *pInfo, bool bDontBroadcast) |
| 354 | { |
no test coverage detected