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

@ -2827,18 +2827,6 @@ static int Sc_ScanString(int ret)
if(!collapseEscape(CMDtext+1))
return -1;
const char* scannedStr = CMDtext + 1;
if (dStrcmp(scannedStr, "true") == 0) {
CMDlval.i = MakeToken<int>(1, yylineno);
return INTCONST;
}
if (dStrcmp(scannedStr, "false") == 0) {
CMDlval.i = MakeToken<int>(0, yylineno);
return INTCONST;
}
dsize_t bufferLen = dStrlen( CMDtext );
char* buffer = ( char* ) consoleAlloc( bufferLen );
dStrcpy( buffer, CMDtext + 1, bufferLen );