mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-21 15:11:33 +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:
parent
617cd4ceb6
commit
85c79d382c
1 changed files with 9 additions and 10 deletions
|
@ -1596,15 +1596,6 @@ namespace MWMechanics
|
||||||
world->setActorCollisionMode(actor.getPtr(), false, false);
|
world->setActorCollisionMode(actor.getPtr(), false, false);
|
||||||
continue;
|
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();
|
const bool isDead = actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isDead();
|
||||||
if (!isDead && (!godmode || !isPlayer) && actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isParalyzed())
|
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
|
// Handle player last, in case a cell transition occurs by casting a teleportation spell
|
||||||
// (would invalidate the iterator)
|
// (would invalidate the iterator)
|
||||||
if (actor.getPtr() == getPlayer())
|
if (isPlayer)
|
||||||
{
|
{
|
||||||
playerCharacter = &ctrl;
|
playerCharacter = &ctrl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actor.getPtr().getRefData().getBaseNode()->setNodeMask(MWRender::Mask_Actor);
|
||||||
world->setActorCollisionMode(actor.getPtr(), true, !actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isDeathAnimationFinished());
|
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);
|
ctrl.update(duration);
|
||||||
|
|
||||||
updateVisibility(actor.getPtr(), ctrl);
|
updateVisibility(actor.getPtr(), ctrl);
|
||||||
|
|
Loading…
Reference in a new issue