forked from mirror/openmw-tes3mp
Fix unsafe use of BaseNode in Move script instruction
This commit is contained in:
parent
a62fe38a1b
commit
0a2dd4c6cb
1 changed files with 4 additions and 0 deletions
|
@ -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…
Reference in a new issue