mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-16 08:42:23 +00:00
Allow a missing implicit argument for GetDistance
This commit is contained in:
parent
0a15d7740a
commit
18f297a4e0
@ -42,10 +42,19 @@ namespace MWScript
|
|||||||
|
|
||||||
void execute (Interpreter::Runtime& runtime) override
|
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);
|
std::string name = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
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?
|
if (from.getContainerStore()) // is the object contained?
|
||||||
{
|
{
|
||||||
MWWorld::Ptr container = MWBase::Environment::get().getWorld()->findContainer(from);
|
MWWorld::Ptr container = MWBase::Environment::get().getWorld()->findContainer(from);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user