mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Merge pull request #787 from JeffProgrammer/ts_strempty_is_now_0
Fix edgecase where empty string was not being explicitly set to 0 in …
This commit is contained in:
commit
30251f5be1
1 changed files with 12 additions and 6 deletions
|
|
@ -229,8 +229,10 @@ public:
|
||||||
return f;
|
return f;
|
||||||
if (type == ConsoleValueType::cvInteger)
|
if (type == ConsoleValueType::cvInteger)
|
||||||
return i;
|
return i;
|
||||||
if (isStringType())
|
if (type == ConsoleValueType::cvSTEntry)
|
||||||
return dAtof(s);
|
return s == StringTable->EmptyString() ? 0.0f : dAtof(s);
|
||||||
|
if (type == ConsoleValueType::cvString)
|
||||||
|
return dStrcmp(s, "") == 0 ? 0.0f : dAtof(s);
|
||||||
return dAtof(getConsoleData());
|
return dAtof(getConsoleData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -240,8 +242,10 @@ public:
|
||||||
return i;
|
return i;
|
||||||
if (type == ConsoleValueType::cvFloat)
|
if (type == ConsoleValueType::cvFloat)
|
||||||
return f;
|
return f;
|
||||||
if (isStringType())
|
if (type == ConsoleValueType::cvSTEntry)
|
||||||
return dAtoi(s);
|
return s == StringTable->EmptyString() ? 0 : dAtoi(s);
|
||||||
|
if (type == ConsoleValueType::cvString)
|
||||||
|
return dStrcmp(s, "") == 0 ? 0 : dAtoi(s);
|
||||||
return dAtoi(getConsoleData());
|
return dAtoi(getConsoleData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -265,8 +269,10 @@ public:
|
||||||
return (bool)i;
|
return (bool)i;
|
||||||
if (type == ConsoleValueType::cvFloat)
|
if (type == ConsoleValueType::cvFloat)
|
||||||
return (bool)f;
|
return (bool)f;
|
||||||
if (isStringType())
|
if (type == ConsoleValueType::cvSTEntry)
|
||||||
return dAtob(s);
|
return s == StringTable->EmptyString() ? false : dAtob(s);
|
||||||
|
if (type == ConsoleValueType::cvString)
|
||||||
|
return dStrcmp(s, "") == 0 ? false : dAtob(s);
|
||||||
return dAtob(getConsoleData());
|
return dAtob(getConsoleData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue