From fd550be6aeb0ba5620a806223f37fe4e841fc920 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 9 Aug 2014 00:01:24 -0400 Subject: [PATCH] fix invalid hex number detection also --- src/lua/TPTScriptInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua/TPTScriptInterface.cpp b/src/lua/TPTScriptInterface.cpp index af983acdc..96ba11d04 100644 --- a/src/lua/TPTScriptInterface.cpp +++ b/src/lua/TPTScriptInterface.cpp @@ -90,7 +90,7 @@ ValueType TPTScriptInterface::testType(std::string word) goto parseFloat; else if (rawWord[i] == ',' && rawWord[i+1] >= '0' && rawWord[i+1] <= '9') goto parsePoint; - else if ((rawWord[i] == '#' || rawWord[i] == 'x') && + else if ((rawWord[i] == '#' || (i && rawWord[i-1] == '0' && rawWord[i] == 'x')) && ((rawWord[i+1] >= '0' && rawWord[i+1] <= '9') || (rawWord[i+1] >= 'a' && rawWord[i+1] <= 'f') || (rawWord[i+1] >= 'A' && rawWord[i+1] <= 'F')))