1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 00:45:34 +00:00

Allow a missing implicit argument for GetDistance

This commit is contained in:
Evil Eye 2021-03-11 20:37:38 +01:00
parent 0a15d7740a
commit 18f297a4e0

View file

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