mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 17:06:43 +00:00
allow additional string argument for stopcombat and addspell (ignored)
This commit is contained in:
parent
6a5d88b640
commit
61626e90da
3 changed files with 17 additions and 13 deletions
|
@ -705,11 +705,11 @@ namespace Compiler
|
||||||
{
|
{
|
||||||
optional = true;
|
optional = true;
|
||||||
}
|
}
|
||||||
else if (*iter=='S' || *iter=='c')
|
else if (*iter=='S' || *iter=='c' || *iter=='x')
|
||||||
{
|
{
|
||||||
stringParser.reset();
|
stringParser.reset();
|
||||||
|
|
||||||
if (optional)
|
if (optional || *iter=='x')
|
||||||
stringParser.setOptional (true);
|
stringParser.setOptional (true);
|
||||||
|
|
||||||
if (*iter=='c') stringParser.smashCase();
|
if (*iter=='c') stringParser.smashCase();
|
||||||
|
@ -718,6 +718,8 @@ namespace Compiler
|
||||||
if (optional && stringParser.isEmpty())
|
if (optional && stringParser.isEmpty())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (*iter!='x')
|
||||||
|
{
|
||||||
if (invert)
|
if (invert)
|
||||||
{
|
{
|
||||||
std::vector<Interpreter::Type_Code> tmp;
|
std::vector<Interpreter::Type_Code> tmp;
|
||||||
|
@ -731,6 +733,7 @@ namespace Compiler
|
||||||
if (optional)
|
if (optional)
|
||||||
++optionalCount;
|
++optionalCount;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parser.reset();
|
parser.reset();
|
||||||
|
|
|
@ -101,6 +101,7 @@ namespace Compiler
|
||||||
/// \param arguments Each character represents one arguments ('l': integer,
|
/// \param arguments Each character represents one arguments ('l': integer,
|
||||||
/// 'f': float, 'S': string, 'c': string (case smashed), '/': following arguments are
|
/// 'f': float, 'S': string, 'c': string (case smashed), '/': following arguments are
|
||||||
/// optional)
|
/// optional)
|
||||||
|
/// 'x': optional string that will be ignored (die in a fire, MW script compiler!)
|
||||||
/// \param invert Store arguments in reverted order.
|
/// \param invert Store arguments in reverted order.
|
||||||
/// \return number of optional arguments
|
/// \return number of optional arguments
|
||||||
};
|
};
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace Compiler
|
||||||
extensions.registerInstruction ("toggleai", "", opcodeToggleAI, opcodeToggleAI);
|
extensions.registerInstruction ("toggleai", "", opcodeToggleAI, opcodeToggleAI);
|
||||||
extensions.registerInstruction ("tai", "", opcodeToggleAI, opcodeToggleAI);
|
extensions.registerInstruction ("tai", "", opcodeToggleAI, opcodeToggleAI);
|
||||||
extensions.registerInstruction("startcombat", "c", opcodeStartCombat, opcodeStartCombatExplicit);
|
extensions.registerInstruction("startcombat", "c", opcodeStartCombat, opcodeStartCombatExplicit);
|
||||||
extensions.registerInstruction("stopcombat", "", opcodeStopCombat, opcodeStopCombatExplicit);
|
extensions.registerInstruction("stopcombat", "x", opcodeStopCombat, opcodeStopCombatExplicit);
|
||||||
extensions.registerFunction ("gethello", 'l', "", opcodeGetHello, opcodeGetHelloExplicit);
|
extensions.registerFunction ("gethello", 'l', "", opcodeGetHello, opcodeGetHelloExplicit);
|
||||||
extensions.registerFunction ("getfight", 'l', "", opcodeGetFight, opcodeGetFightExplicit);
|
extensions.registerFunction ("getfight", 'l', "", opcodeGetFight, opcodeGetFightExplicit);
|
||||||
extensions.registerFunction ("getflee", 'l', "", opcodeGetFlee, opcodeGetFleeExplicit);
|
extensions.registerFunction ("getflee", 'l', "", opcodeGetFlee, opcodeGetFleeExplicit);
|
||||||
|
@ -398,7 +398,7 @@ namespace Compiler
|
||||||
extensions.registerInstruction ("setpccrimelevel", "f", opcodeSetPCCrimeLevel);
|
extensions.registerInstruction ("setpccrimelevel", "f", opcodeSetPCCrimeLevel);
|
||||||
extensions.registerInstruction ("modpccrimelevel", "f", opcodeModPCCrimeLevel);
|
extensions.registerInstruction ("modpccrimelevel", "f", opcodeModPCCrimeLevel);
|
||||||
|
|
||||||
extensions.registerInstruction ("addspell", "c", opcodeAddSpell, opcodeAddSpellExplicit);
|
extensions.registerInstruction ("addspell", "cx", opcodeAddSpell, opcodeAddSpellExplicit);
|
||||||
extensions.registerInstruction ("removespell", "c", opcodeRemoveSpell,
|
extensions.registerInstruction ("removespell", "c", opcodeRemoveSpell,
|
||||||
opcodeRemoveSpellExplicit);
|
opcodeRemoveSpellExplicit);
|
||||||
extensions.registerInstruction ("removespelleffects", "c", opcodeRemoveSpellEffects,
|
extensions.registerInstruction ("removespelleffects", "c", opcodeRemoveSpellEffects,
|
||||||
|
|
Loading…
Reference in a new issue