forked from teamnwah/openmw-tes3coop
automatically get target ID at InterpreterContext construction, if a reference is available
This commit is contained in:
parent
4fb897f2f8
commit
6a3ff211b1
1 changed files with 7 additions and 1 deletions
|
@ -107,7 +107,13 @@ namespace MWScript
|
||||||
MWScript::Locals *locals, MWWorld::Ptr reference, const std::string& targetId)
|
MWScript::Locals *locals, MWWorld::Ptr reference, const std::string& targetId)
|
||||||
: mLocals (locals), mReference (reference),
|
: mLocals (locals), mReference (reference),
|
||||||
mActivationHandled (false), mTargetId (targetId)
|
mActivationHandled (false), mTargetId (targetId)
|
||||||
{}
|
{
|
||||||
|
// If we run on a reference (local script, dialogue script or console with object
|
||||||
|
// selected), store the ID of that reference store it so it can be inherited by
|
||||||
|
// targeted scripts started from this one.
|
||||||
|
if (targetId.empty() && !reference.isEmpty())
|
||||||
|
mTargetId = reference.getClass().getId (reference);
|
||||||
|
}
|
||||||
|
|
||||||
int InterpreterContext::getLocalShort (int index) const
|
int InterpreterContext::getLocalShort (int index) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue