forked from mirror/openmw-tes3mp
Fix Ptr updates in PositionCell
This was not the proper way to get the updated Ptr, it will only work for the player which isn't owned by any cell. For other objects, moving between cells makes the object owned by that cell and thus the getBase() pointer will change.
This commit is contained in:
parent
9e3eb8291f
commit
19cd987208
1 changed files with 3 additions and 4 deletions
|
@ -312,8 +312,8 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
if(store)
|
if(store)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWorld()->moveObject(ptr,store,x,y,z);
|
ptr = MWBase::Environment::get().getWorld()->moveObject(ptr,store,x,y,z);
|
||||||
ptr = MWWorld::Ptr(ptr.getBase(), store);
|
|
||||||
dynamic_cast<MWScript::InterpreterContext&>(runtime.getContext()).updatePtr(ptr);
|
dynamic_cast<MWScript::InterpreterContext&>(runtime.getContext()).updatePtr(ptr);
|
||||||
|
|
||||||
float ax = osg::RadiansToDegrees(ptr.getRefData().getPosition().rot[0]);
|
float ax = osg::RadiansToDegrees(ptr.getRefData().getPosition().rot[0]);
|
||||||
|
@ -363,8 +363,7 @@ namespace MWScript
|
||||||
if (ptr == MWMechanics::getPlayer())
|
if (ptr == MWMechanics::getPlayer())
|
||||||
{
|
{
|
||||||
MWWorld::CellStore* cell = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
|
MWWorld::CellStore* cell = MWBase::Environment::get().getWorld()->getExterior(cx,cy);
|
||||||
MWBase::Environment::get().getWorld()->moveObject(ptr,cell,x,y,z);
|
ptr = MWBase::Environment::get().getWorld()->moveObject(ptr,cell,x,y,z);
|
||||||
ptr = MWWorld::Ptr(ptr.getBase(), cell);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue