@@ -998,6 +998,22 @@ static cell_t smn_TRGetHitGroup(IPluginContext *pContext, const cell_t *params)
998998 return tr->hitgroup ;
999999}
10001000
1001+ static cell_t smn_TRGetHitBoxIndex (IPluginContext *pContext, const cell_t *params)
1002+ {
1003+ sm_trace_t *tr;
1004+ HandleError err;
1005+ HandleSecurity sec (pContext->GetIdentity (), myself->GetIdentity ());
1006+
1007+ if (params[1 ] == BAD_HANDLE)
1008+ {
1009+ tr = &g_Trace;
1010+ } else if ((err = handlesys->ReadHandle (params[1 ], g_TraceHandle, &sec, (void **)&tr)) != HandleError_None) {
1011+ return pContext->ThrowNativeError (" Invalid Handle %x (error %d)" , params[1 ], err);
1012+ }
1013+
1014+ return tr->hitbox ;
1015+ }
1016+
10011017static cell_t smn_TRGetEntityIndex (IPluginContext *pContext, const cell_t *params)
10021018{
10031019 sm_trace_t *tr;
@@ -1102,6 +1118,7 @@ sp_nativeinfo_t g_TRNatives[] =
11021118 {" TR_StartSolid" , smn_TRStartSolid},
11031119 {" TR_DidHit" , smn_TRDidHit},
11041120 {" TR_GetHitGroup" , smn_TRGetHitGroup},
1121+ {" TR_GetHitBoxIndex" , smn_TRGetHitBoxIndex},
11051122 {" TR_ClipRayToEntity" , smn_TRClipRayToEntity},
11061123 {" TR_ClipRayToEntityEx" , smn_TRClipRayToEntityEx},
11071124 {" TR_ClipRayHullToEntity" , smn_TRClipRayHullToEntity},
0 commit comments