1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 03:40:14 +00:00

Enable collisions for actor before adjusting position

Otherwise adjustPosition does not call traceDown and actor appears flying for
the first physics simulation.
This commit is contained in:
elsid 2022-05-24 23:25:23 +02:00
parent 617cd4ceb6
commit 85c79d382c
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

View File

@ -1596,15 +1596,6 @@ namespace MWMechanics
world->setActorCollisionMode(actor.getPtr(), false, false);
continue;
}
else if (!isPlayer)
{
actor.getPtr().getRefData().getBaseNode()->setNodeMask(MWRender::Mask_Actor);
if (!actor.getPositionAdjusted())
{
actor.getPtr().getClass().adjustPosition(actor.getPtr(), false);
actor.setPositionAdjusted(true);
}
}
const bool isDead = actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isDead();
if (!isDead && (!godmode || !isPlayer) && actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isParalyzed())
@ -1612,13 +1603,21 @@ namespace MWMechanics
// Handle player last, in case a cell transition occurs by casting a teleportation spell
// (would invalidate the iterator)
if (actor.getPtr() == getPlayer())
if (isPlayer)
{
playerCharacter = &ctrl;
continue;
}
actor.getPtr().getRefData().getBaseNode()->setNodeMask(MWRender::Mask_Actor);
world->setActorCollisionMode(actor.getPtr(), true, !actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isDeathAnimationFinished());
if (!actor.getPositionAdjusted())
{
actor.getPtr().getClass().adjustPosition(actor.getPtr(), false);
actor.setPositionAdjusted(true);
}
ctrl.update(duration);
updateVisibility(actor.getPtr(), ctrl);