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

Method FindOutputPointer

extensions/sdktools/output.cpp:307–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305}
306
307OutputNameStruct *EntityOutputManager::FindOutputPointer(const char *classname, const char *outputname, bool create)
308{
309 ClassNameStruct *pClassname;
310
311 if (!ClassNames->Retrieve(classname, (void **)&pClassname))
312 {
313 if (create)
314 {
315 pClassname = new ClassNameStruct;
316 ClassNames->Insert(classname, pClassname);
317 }
318 else
319 {
320 return NULL;
321 }
322 }
323
324 OutputNameStruct *pOutputName;
325
326 if (!pClassname->OutputList->Retrieve(outputname, (void **)&pOutputName))
327 {
328 if (create)
329 {
330 pOutputName = new OutputNameStruct;
331 pClassname->OutputList->Insert(outputname, pOutputName);
332 strncpy(pOutputName->Name, outputname, sizeof(pOutputName->Name));
333 pOutputName->Name[49] = 0;
334 }
335 else
336 {
337 return NULL;
338 }
339 }
340
341 return pOutputName;
342}
343
344// Iterate the datamap of pCaller/pActivator and look for output pointers with the same address as pOutput.
345// Store the classname of the entity we found the output on in |entity_classname| if provided.

Callers 4

HookSingleEntityOutputFunction · 0.80
HookEntityOutputFunction · 0.80
UnHookEntityOutputFunction · 0.80
UnHookSingleEntityOutputFunction · 0.80

Calls 2

RetrieveMethod · 0.80
InsertMethod · 0.45

Tested by

no test coverage detected