From c1e50f530b6b7c229864b20ab26be284e3edec42 Mon Sep 17 00:00:00 2001 From: fredzio Date: Sat, 7 Aug 2021 12:40:08 +0200 Subject: [PATCH] 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. --- apps/openmw/mwphysics/physicssystem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/openmw/mwphysics/physicssystem.cpp b/apps/openmw/mwphysics/physicssystem.cpp index f8862ea400..0afeb2d622 100644 --- a/apps/openmw/mwphysics/physicssystem.cpp +++ b/apps/openmw/mwphysics/physicssystem.cpp @@ -725,8 +725,7 @@ namespace MWPhysics auto actor = std::make_shared(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)); }