1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-22 13:39:40 +00:00

Use the PhysicsSystem::movementQueue instead of a serie of

setPosition(getPosition() + diff) to move actor in scripts.
With background physics, this is very slightly off with the collision
object position.
When the script run long enough (a few dozen frames for instance),
the accumulated error becomes too big. It make actors fall through lifts floors.
This commit is contained in:
fredzio 2020-10-30 23:53:07 +01:00
parent 4bbed3c860
commit 4876969153

View file

@ -32,11 +32,7 @@ namespace MWScript
std::vector<MWWorld::Ptr> actors;
MWBase::Environment::get().getWorld()->getActorsStandingOn (ptr, actors);
for (auto& actor : actors)
{
osg::Vec3f actorPos(actor.getRefData().getPosition().asVec3());
actorPos += diff;
MWBase::Environment::get().getWorld()->moveObject(actor, actorPos.x(), actorPos.y(), actorPos.z());
}
MWBase::Environment::get().getWorld()->queueMovement(actor, diff);
}
template<class R>