1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00

Make PositionCell take additional junk arguments

This commit is contained in:
Evil Eye 2021-10-21 16:54:32 +02:00
parent dfb6bdf77e
commit 31aa19574b
3 changed files with 11 additions and 1 deletions

View File

@ -553,7 +553,7 @@ namespace Compiler
extensions.registerFunction("getpos",'f',"c",opcodeGetPos,opcodeGetPosExplicit);
extensions.registerFunction("getstartingpos",'f',"c",opcodeGetStartingPos,opcodeGetStartingPosExplicit);
extensions.registerInstruction("position","ffffz",opcodePosition,opcodePositionExplicit);
extensions.registerInstruction("positioncell","ffffcX",opcodePositionCell,opcodePositionCellExplicit);
extensions.registerInstruction("positioncell","ffffczz",opcodePositionCell,opcodePositionCellExplicit);
extensions.registerInstruction("placeitemcell","ccffffX",opcodePlaceItemCell);
extensions.registerInstruction("placeitem","cffffX",opcodePlaceItem);
extensions.registerInstruction("placeatpc","clflX",opcodePlaceAtPc);

View File

@ -86,6 +86,12 @@ namespace Compiler
return Parser::parseSpecial (code, loc, scanner);
}
bool StringParser::parseInt (int value, const TokenLoc& loc, Scanner& scanner)
{
reportWarning("Treating integer argument as a string", loc);
return parseName(loc.mLiteral, loc, scanner);
}
void StringParser::append (std::vector<Interpreter::Type_Code>& code)
{
std::copy (mCode.begin(), mCode.end(), std::back_inserter (code));

View File

@ -43,6 +43,10 @@ namespace Compiler
///< Handle a special character token.
/// \return fetch another token?
bool parseInt (int value, const TokenLoc& loc, Scanner& scanner) override;
///< Handle an int token.
/// \return fetch another token?
void append (std::vector<Interpreter::Type_Code>& code);
///< Append code for parsed string.