MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / CreateEvent

Method CreateEvent

core/EventManager.cpp:327–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327EventInfo *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
353void EventManager::FireEvent(EventInfo *pInfo, bool bDontBroadcast)
354{

Callers 2

NotifyConVarFunction · 0.80
sm_CreateEventFunction · 0.80

Calls 3

emptyMethod · 0.80
popMethod · 0.80
GetIdentityMethod · 0.45

Tested by

no test coverage detected