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

Function smn_BfReadEntity

core/smn_bitbuffer.cpp:519–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519static cell_t smn_BfReadEntity(IPluginContext *pCtx, const cell_t *params)
520{
521 Handle_t hndl = static_cast<Handle_t>(params[1]);
522 HandleError herr;
523 HandleSecurity sec;
524 bf_read *pBitBuf;
525
526 sec.pOwner = NULL;
527 sec.pIdentity = g_pCoreIdent;
528
529 if ((herr=handlesys->ReadHandle(hndl, g_RdBitBufType, &sec, (void **)&pBitBuf))
530 != HandleError_None)
531 {
532 return pCtx->ThrowNativeError("Invalid bit buffer handle %x (error %d)", hndl, herr);
533 }
534
535 int ref = g_HL2.IndexToReference(pBitBuf->ReadShort());
536
537 return g_HL2.ReferenceToBCompatRef(ref);
538}
539
540static cell_t smn_BfReadAngle(IPluginContext *pCtx, const cell_t *params)
541{

Callers

nothing calls this directly

Calls 3

IndexToReferenceMethod · 0.80
ReferenceToBCompatRefMethod · 0.80
ReadHandleMethod · 0.45

Tested by

no test coverage detected