mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
suggestion by Zini for SetDelete
This commit is contained in:
parent
d6dd212ce8
commit
644dacf603
1 changed files with 11 additions and 2 deletions
|
@ -365,7 +365,16 @@ namespace MWScript
|
|||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
MWWorld::Ptr ptr = R()(runtime);
|
||||
int parameter = runtime[0].mInteger;
|
||||
runtime.pop();
|
||||
|
||||
if (parameter == 1)
|
||||
{
|
||||
if (ptr.isInCell())
|
||||
MWBase::Environment::get().getWorld()->deleteObject (ptr);
|
||||
else
|
||||
ptr.getRefData().setCount(0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -447,7 +456,7 @@ namespace MWScript
|
|||
extensions.registerFunction ("getweapondrawn", 'l', "", opcodeGetWeaponDrawn, opcodeGetWeaponDrawnExplicit);
|
||||
extensions.registerFunction ("getspelleffects", 'l', "c", opcodeGetSpellEffects, opcodeGetSpellEffectsExplicit);
|
||||
extensions.registerFunction ("getcurrenttime", 'f', "", opcodeGetCurrentTime);
|
||||
extensions.registerInstruction ("setdelete", "", opcodeSetDelete, opcodeSetDeleteExplicit);
|
||||
extensions.registerInstruction ("setdelete", "l", opcodeSetDelete, opcodeSetDeleteExplicit);
|
||||
extensions.registerFunction ("getsquareroot", 'f', "f", opcodeGetSquareRoot);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue