1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-28 23:06:41 +00:00

Calls directly MovementSolver::traceDown instead of

PhysicsSystem::traceDown before inserting into mActors.

The latter does nothing until the actor is inserted into mActors.
We can't move the call after the insertion either because then
the actor is part of the simulation, and we'd have a race.
This commit is contained in:
fredzio 2021-08-07 12:40:08 +02:00
parent 8ad3d3d792
commit c1e50f530b

View file

@ -725,8 +725,7 @@ namespace MWPhysics
auto actor = std::make_shared<Actor>(ptr, shape, mTaskScheduler.get(), canWaterWalk);
// check if Actor is on the ground or in the air
traceDown(ptr, ptr.getRefData().getPosition().asVec3(), 10.f);
MovementSolver::traceDown(ptr, ptr.getRefData().getPosition().asVec3(), actor.get(), mCollisionWorld.get(), 10);
mActors.emplace(ptr, std::move(actor));
}