diff --git a/apps/openmw/mwscript/transformationextensions.cpp b/apps/openmw/mwscript/transformationextensions.cpp index 825306d650..096e78d34b 100644 --- a/apps/openmw/mwscript/transformationextensions.cpp +++ b/apps/openmw/mwscript/transformationextensions.cpp @@ -42,10 +42,19 @@ namespace MWScript void execute (Interpreter::Runtime& runtime) override { - MWWorld::Ptr from = R()(runtime); + MWWorld::Ptr from = R()(runtime, !R::implicit); std::string name = runtime.getStringLiteral (runtime[0].mInteger); runtime.pop(); + if (from.isEmpty()) + { + std::string error = "Missing implicit ref"; + runtime.getContext().report(error); + Log(Debug::Error) << error; + runtime.push(0.f); + return; + } + if (from.getContainerStore()) // is the object contained? { MWWorld::Ptr container = MWBase::Environment::get().getWorld()->findContainer(from);