| 283 | } |
| 284 | |
| 285 | static cell_t smn_KvSetVector(IPluginContext *pCtx, const cell_t *params) |
| 286 | { |
| 287 | Handle_t hndl = static_cast<Handle_t>(params[1]); |
| 288 | HandleError herr; |
| 289 | HandleSecurity sec; |
| 290 | KeyValueStack *pStk; |
| 291 | |
| 292 | sec.pOwner = NULL; |
| 293 | sec.pIdentity = g_pCoreIdent; |
| 294 | |
| 295 | if ((herr=handlesys->ReadHandle(hndl, g_KeyValueType, &sec, (void **)&pStk)) |
| 296 | != HandleError_None) |
| 297 | { |
| 298 | return pCtx->ThrowNativeError("Invalid key value handle %x (error %d)", hndl, herr); |
| 299 | } |
| 300 | |
| 301 | char *key; |
| 302 | char buffer[64]; |
| 303 | cell_t *vector; |
| 304 | pCtx->LocalToStringNULL(params[2], &key); |
| 305 | pCtx->LocalToPhysAddr(params[3], &vector); |
| 306 | |
| 307 | ke::SafeSprintf(buffer, sizeof(buffer), "%f %f %f", sp_ctof(vector[0]), sp_ctof(vector[1]), sp_ctof(vector[2])); |
| 308 | |
| 309 | pStk->pCurRoot.front()->SetString(key, buffer); |
| 310 | |
| 311 | return 1; |
| 312 | } |
| 313 | |
| 314 | static cell_t smn_KvGetString(IPluginContext *pCtx, const cell_t *params) |
| 315 | { |
nothing calls this directly
no test coverage detected