MCPcopy Create free account
hub / github.com/assaultcube/AC / getvarrange

Function getvarrange

source/src/command.cpp:265–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263
264#ifndef STANDALONE
265void getvarrange(char *_what, char *name)
266{
267 ident *id = idents->access(name);
268 const char *attrs[] = { "min", "max", "default", "" };
269 int what = getlistindex(_what, attrs, false, -1);
270 if(id)
271 {
272 int *i = NULL;
273 switch(what)
274 {
275 case 0: i = &(id->minval); break;
276 case 1: i = &(id->maxval); break;
277 case 2: i = &(id->defaultval); break;
278 }
279 if(i) switch(id->type)
280 {
281 case ID_VAR: intret(*i); return;
282 case ID_FVAR: floatret(*((float *) i), true); return;
283 }
284 }
285 result("");
286}
287COMMAND(getvarrange, "ss");
288#endif
289

Callers

nothing calls this directly

Calls 5

getlistindexFunction · 0.85
intretFunction · 0.85
floatretFunction · 0.85
resultFunction · 0.85
accessMethod · 0.80

Tested by

no test coverage detected