Fix unsafe use of BaseNode in Move script instruction

moveref
scrawl 10 years ago
parent a62fe38a1b
commit 0a2dd4c6cb

@ -689,7 +689,11 @@ namespace MWScript
else
throw std::runtime_error ("invalid movement axis: " + axis);
if (!ptr.getRefData().getBaseNode())
return;
Ogre::Vector3 worldPos = ptr.getRefData().getBaseNode()->convertLocalToWorldPosition(posChange);
dynamic_cast<MWScript::InterpreterContext&>(runtime.getContext()).updatePtr(
MWBase::Environment::get().getWorld()->moveObject(ptr, worldPos.x, worldPos.y, worldPos.z));
}

Loading…
Cancel
Save