tscript change

Adds the ability to declare defaults for function arguments

eg
function testFunc(%x = 1, %y = 1)
{
    return %x + %y;
}

can now be called as
testFunc(10) and it will return the value of 11.
This commit is contained in:
marauder2k7 2025-11-15 17:34:33 +00:00
parent 7e64493dbf
commit b0f8a5f9bd
8 changed files with 1375 additions and 1206 deletions

View file

@ -130,6 +130,10 @@ public:
/// The offset in the compiled script code at which this function begins.
U32 mFunctionOffset;
// Offsets to get default values for arguments.
Vector<U32> mArgFlags;
Vector<ConsoleValue> mDefaultValues;
/// If it's a script function, this is the line of the declaration in code.
/// @note 0 for functions read from legacy DSOs that have no line number information.
U32 mFunctionLineNumber;