mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 06:34:36 +00:00
if statement
treat "true" as a bool in getInt check (inside if statements for strings) no longer convert all "true" and "false" to ints
This commit is contained in:
parent
e56f4cb6a6
commit
d6a79e4f5b
3 changed files with 11 additions and 25 deletions
|
|
@ -245,7 +245,17 @@ public:
|
|||
if (type == ConsoleValueType::cvSTEntry)
|
||||
return s == StringTable->EmptyString() ? 0 : dAtoi(s);
|
||||
if (type == ConsoleValueType::cvString)
|
||||
return dStrcmp(s, "") == 0 ? 0 : dIsdigit(*s) ? dAtoi(s) : s == StringTable->EmptyString() ? 0 : 1;
|
||||
{
|
||||
if (dStrcmp(s, "false") == 0) {
|
||||
return 0;
|
||||
}
|
||||
else if (dStrcmp(s, "true") == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return dIsdigit(*s) ? dAtoi(s) : s == StringTable->EmptyString() ? 0 : 1;
|
||||
}
|
||||
|
||||
return dAtoi(getConsoleData());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue