native SetStructFloat(Handle:struct, const String:member[], Float:value);
| 187 | |
| 188 | //native SetStructFloat(Handle:struct, const String:member[], Float:value); |
| 189 | static cell_t SetStructFloat(IPluginContext *pContext, const cell_t *params) |
| 190 | { |
| 191 | Handle_t hndl = static_cast<Handle_t>(params[1]); |
| 192 | HandleError err; |
| 193 | HandleSecurity sec; |
| 194 | |
| 195 | sec.pOwner = NULL; |
| 196 | sec.pIdentity = myself->GetIdentity(); |
| 197 | |
| 198 | StructHandle *pHandle; |
| 199 | if ((err = g_pHandleSys->ReadHandle(hndl, g_StructHandle, &sec, (void **)&pHandle)) |
| 200 | != HandleError_None) |
| 201 | { |
| 202 | return pContext->ThrowNativeError("Invalid struct handle %x (error %d)", hndl, err); |
| 203 | } |
| 204 | |
| 205 | char *member; |
| 206 | pContext->LocalToString(params[2], &member); |
| 207 | |
| 208 | if (!pHandle->SetFloat(member, sp_ctof(params[3]))) |
| 209 | { |
| 210 | return pContext->ThrowNativeError("Invalid member, or incorrect data type"); |
| 211 | } |
| 212 | |
| 213 | return 1; |
| 214 | } |
| 215 | |
| 216 | //native GetStructVector(Handle:struct, const String:member[], Float:vec[3]); |
| 217 | static cell_t GetStructVector(IPluginContext *pContext, const cell_t *params) |
nothing calls this directly
no test coverage detected