mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 08:37:12 +00:00
Fix unsafe use of BaseNode in Move script instruction
This commit is contained in:
parent
a62fe38a1b
commit
0a2dd4c6cb
@ -689,7 +689,11 @@ namespace MWScript
|
|||||||
else
|
else
|
||||||
throw std::runtime_error ("invalid movement axis: " + axis);
|
throw std::runtime_error ("invalid movement axis: " + axis);
|
||||||
|
|
||||||
|
if (!ptr.getRefData().getBaseNode())
|
||||||
|
return;
|
||||||
|
|
||||||
Ogre::Vector3 worldPos = ptr.getRefData().getBaseNode()->convertLocalToWorldPosition(posChange);
|
Ogre::Vector3 worldPos = ptr.getRefData().getBaseNode()->convertLocalToWorldPosition(posChange);
|
||||||
|
|
||||||
dynamic_cast<MWScript::InterpreterContext&>(runtime.getContext()).updatePtr(
|
dynamic_cast<MWScript::InterpreterContext&>(runtime.getContext()).updatePtr(
|
||||||
MWBase::Environment::get().getWorld()->moveObject(ptr, worldPos.x, worldPos.y, worldPos.z));
|
MWBase::Environment::get().getWorld()->moveObject(ptr, worldPos.x, worldPos.y, worldPos.z));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user