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:
marauder2k7 2024-06-16 20:01:47 +01:00
parent e56f4cb6a6
commit d6a79e4f5b
3 changed files with 11 additions and 25 deletions

View file

@ -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());
}