Strip quotes when treating keywords as strings

dont-compose-content
Evil Eye 4 years ago
parent ff0fd2f684
commit 22f7d4eee2

@ -4,6 +4,7 @@
Bug #3737: Scripts from The Underground 2 .esp do not play (all patched versions)
Bug #3846: Strings starting with "-" fail to compile if not enclosed in quotes
Bug #5483: AutoCalc flag is not used to calculate spells cost
Bug #6066: addtopic "return" does not work from within script. No errors thrown
Bug #6101: Disarming trapped unlocked owned objects isn't considered a crime
0.47.0

@ -65,7 +65,11 @@ namespace Compiler
keyword==Scanner::K_messagebox || keyword==Scanner::K_set ||
keyword==Scanner::K_to || keyword==Scanner::K_getsquareroot)
{
return parseName (loc.mLiteral, loc, scanner);
// pretend this is not a keyword
std::string name = loc.mLiteral;
if (name.size()>=2 && name[0]=='"' && name[name.size()-1]=='"')
name = name.substr (1, name.size()-2);
return parseName (name, loc, scanner);
}
return Parser::parseKeyword (keyword, loc, scanner);

Loading…
Cancel
Save