1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 02:09:41 +00:00

Merge branch 'keyword_soup' into 'master'

Strip quotes when treating keywords as strings

Closes #6066

See merge request OpenMW/openmw!921
This commit is contained in:
jvoisin 2021-06-24 19:51:58 +00:00
commit b4cfa4328e
2 changed files with 6 additions and 1 deletions

View file

@ -5,6 +5,7 @@
Bug #3846: Strings starting with "-" fail to compile if not enclosed in quotes
Bug #5453: Magic effect VFX are offset for creatures
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

View file

@ -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);