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

Merge branch 'freedomofteleportation' into 'master'

Pass a cell id when teleporting to an exterior

Closes #7317

See merge request OpenMW/openmw!2907
This commit is contained in:
psi29a 2023-04-08 13:54:04 +00:00
commit 8cd5b91b4a
2 changed files with 3 additions and 9 deletions

View File

@ -487,9 +487,7 @@ namespace MWMechanics
world->getPlayer().getMarkedPosition(markedCell, markedPosition); world->getPlayer().getMarkedPosition(markedCell, markedPosition);
if (markedCell) if (markedCell)
{ {
ESM::RefId dest; ESM::RefId dest = markedCell->getCell()->getId();
if (!markedCell->isExterior())
dest = markedCell->getCell()->getId();
MWWorld::ActionTeleport action(dest, markedPosition, false); MWWorld::ActionTeleport action(dest, markedPosition, false);
action.execute(target); action.execute(target);
if (!caster.isEmpty()) if (!caster.isEmpty())

View File

@ -1436,9 +1436,7 @@ namespace MWWorld
esmPos.pos[0] = traced.x(); esmPos.pos[0] = traced.x();
esmPos.pos[1] = traced.y(); esmPos.pos[1] = traced.y();
esmPos.pos[2] = traced.z(); esmPos.pos[2] = traced.z();
ESM::RefId cell; ESM::RefId cell = actor.getCell()->getCell()->getId();
if (!actor.getCell()->isExterior())
cell = actor.getCell()->getCell()->getId();
MWWorld::ActionTeleport(cell, esmPos, false).execute(actor); MWWorld::ActionTeleport(cell, esmPos, false).execute(actor);
} }
} }
@ -3447,9 +3445,7 @@ namespace MWWorld
return; return;
} }
ESM::RefId cellId; ESM::RefId cellId = closestMarker.mCell->getCell()->getId();
if (!closestMarker.mCell->isExterior())
cellId = closestMarker.mCell->getCell()->getId();
MWWorld::ActionTeleport action(cellId, closestMarker.getRefData().getPosition(), false); MWWorld::ActionTeleport action(cellId, closestMarker.getRefData().getPosition(), false);
action.execute(ptr); action.execute(ptr);