From d78082d368ccb945e90594f2178202f2c499c484 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Mon, 1 Oct 2012 12:14:47 +0100 Subject: Negative values in old console commands diff --git a/src/cat/TPTScriptInterface.cpp b/src/cat/TPTScriptInterface.cpp index ce7128f..9cfba07 100644 --- a/src/cat/TPTScriptInterface.cpp +++ b/src/cat/TPTScriptInterface.cpp @@ -85,13 +85,15 @@ ValueType TPTScriptInterface::testType(std::string word) //Basic type parseNumber: for(i = 0; i < word.length(); i++) - if(!(rawWord[i] >= '0' && rawWord[i] <= '9') && rawWord[i] != '.') + { + if(!(rawWord[i] >= '0' && rawWord[i] <= '9') && rawWord[i] != '.' && !(rawWord[i] == '-' && !i)) { if(rawWord[i] == ',' && rawWord[i+1] >= '0' && rawWord[i+1] <= '9') goto parsePoint; else goto parseString; } + } return TypeNumber; parsePoint: i++; -- cgit v0.9.2-21-gd62e