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

Function GetVectorLength

core/smn_vector.cpp:45–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43 addr[2] = sp_ftoc(vec.z);
44
45static cell_t GetVectorLength(IPluginContext *pContext, const cell_t *params)
46{
47 cell_t *addr;
48
49 pContext->LocalToPhysAddr(params[1], &addr);
50
51 Vector source(sp_ctof(addr[0]), sp_ctof(addr[1]), sp_ctof(addr[2]));
52
53 if (!params[2])
54 {
55 return sp_ftoc(source.Length());
56 } else {
57 return sp_ftoc(source.LengthSqr());
58 }
59}
60
61static cell_t GetVectorDistance(IPluginContext *pContext, const cell_t *params)
62{

Callers

nothing calls this directly

Calls 1

LengthMethod · 0.80

Tested by

no test coverage detected