Allow a missing implicit argument for GetDistance

dont-compose-content
Evil Eye 4 years ago
parent 0a15d7740a
commit 18f297a4e0

@ -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);

Loading…
Cancel
Save