MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / parseFloatExpr

Function parseFloatExpr

src/bzflag/CommandsImplementation.cpp:507–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505};
506
507static float parseFloatExpr(const std::string& str, bool zeroNan) {
508 // BZDB.eval() can't take expressions directly
509 BZDB.set("tmp", str);
510 BZDB.setPersistent("tmp", false);
511 float value = BZDB.eval("tmp");
512 if (!zeroNan || !isnan(value)) {
513 return value;
514 }
515 else {
516 if (!isnan(value)) {
517 return value;
518 }
519 else {
520 return 0.0f;
521 }
522 }
523}
524
525static bool varIsEqual(const std::string& name) {
526 // only looking for standard server variables

Callers 2

varIsEqualFunction · 0.85
operator()Method · 0.85

Calls 4

setPersistentMethod · 0.80
evalMethod · 0.80
isnanFunction · 0.50
setMethod · 0.45

Tested by

no test coverage detected