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

Function FrameIterator_LineNumber

core/logic/smn_core.cpp:1120–1142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1118}
1119
1120static cell_t FrameIterator_LineNumber(IPluginContext *pContext, const cell_t *params)
1121{
1122 Handle_t hndl = (Handle_t)params[1];
1123 HandleError err;
1124 SafeFrameIterator *iterator;
1125
1126 HandleSecurity sec;
1127 sec.pIdentity = g_pCoreIdent;
1128 sec.pOwner = pContext->GetIdentity();
1129
1130 if ((err=handlesys->ReadHandle(hndl, g_FrameIter, &sec, (void **)&iterator)) != HandleError_None)
1131 {
1132 return pContext->ThrowNativeError("Could not read Handle %x (error %d)", hndl, err);
1133 }
1134
1135 int lineNum = iterator->LineNumber();
1136 if (lineNum < 0)
1137 {
1138 return pContext->ThrowNativeError("Iterator out of bounds. Check return value of FrameIterator.Next");
1139 }
1140
1141 return lineNum;
1142}
1143
1144static cell_t FrameIterator_GetFunctionName(IPluginContext *pContext, const cell_t *params)
1145{

Callers

nothing calls this directly

Calls 3

GetIdentityMethod · 0.45
ReadHandleMethod · 0.45
LineNumberMethod · 0.45

Tested by

no test coverage detected