mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-02 12:32:40 +02:00
Correct return type for TPTScriptInterface::parseInt
so that large integers don't get changed into slightly different values by rounding caused by conversion to a float and back again.
This commit is contained in:
@@ -124,7 +124,7 @@ ValueType TPTScriptInterface::testType(std::string word)
|
||||
return TypeString;
|
||||
}
|
||||
|
||||
float TPTScriptInterface::parseNumber(char * stringData)
|
||||
int TPTScriptInterface::parseNumber(char * stringData)
|
||||
{
|
||||
char cc;
|
||||
int base = 10;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
class TPTScriptInterface: public CommandInterface {
|
||||
protected:
|
||||
AnyType eval(std::deque<std::string> * words);
|
||||
float parseNumber(char * stringData);
|
||||
int parseNumber(char * stringData);
|
||||
AnyType tptS_set(std::deque<std::string> * words);
|
||||
AnyType tptS_create(std::deque<std::string> * words);
|
||||
AnyType tptS_delete(std::deque<std::string> * words);
|
||||
|
Reference in New Issue
Block a user