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:
parent
0a15d7740a
commit
18f297a4e0
1 changed files with 10 additions and 1 deletions
|
@ -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…
Reference in a new issue