mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 05:53:50 +00:00
Merge remote-tracking branch 'aesylwinn/FixInteriorCellRefTeleportation'
This commit is contained in:
commit
316cf40f12
3 changed files with 17 additions and 7 deletions
|
@ -37,11 +37,16 @@ std::string CSMWorld::CellCoordinates::getId (const std::string& worldspace) con
|
||||||
return stream.str();
|
return stream.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CSMWorld::CellCoordinates::isExteriorCell (const std::string& id)
|
||||||
|
{
|
||||||
|
return (!id.empty() && id[0]=='#');
|
||||||
|
}
|
||||||
|
|
||||||
std::pair<CSMWorld::CellCoordinates, bool> CSMWorld::CellCoordinates::fromId (
|
std::pair<CSMWorld::CellCoordinates, bool> CSMWorld::CellCoordinates::fromId (
|
||||||
const std::string& id)
|
const std::string& id)
|
||||||
{
|
{
|
||||||
// no worldspace for now, needs to be changed for 1.1
|
// no worldspace for now, needs to be changed for 1.1
|
||||||
if (!id.empty() && id[0]=='#')
|
if (isExteriorCell(id))
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
char ignore;
|
char ignore;
|
||||||
|
|
|
@ -32,6 +32,8 @@ namespace CSMWorld
|
||||||
std::string getId (const std::string& worldspace) const;
|
std::string getId (const std::string& worldspace) const;
|
||||||
///< Return the ID for the cell at these coordinates.
|
///< Return the ID for the cell at these coordinates.
|
||||||
|
|
||||||
|
static bool isExteriorCell (const std::string& id);
|
||||||
|
|
||||||
/// \return first: CellCoordinates (or 0, 0 if cell does not have coordinates),
|
/// \return first: CellCoordinates (or 0, 0 if cell does not have coordinates),
|
||||||
/// second: is cell paged?
|
/// second: is cell paged?
|
||||||
///
|
///
|
||||||
|
|
|
@ -644,6 +644,8 @@ void CSVRender::Object::apply (CSMWorld::CommandMacro& commands)
|
||||||
int column = collection.findColumnIndex (static_cast<CSMWorld::Columns::ColumnId> (
|
int column = collection.findColumnIndex (static_cast<CSMWorld::Columns::ColumnId> (
|
||||||
CSMWorld::Columns::ColumnId_Cell));
|
CSMWorld::Columns::ColumnId_Cell));
|
||||||
|
|
||||||
|
if (CSMWorld::CellCoordinates::isExteriorCell(collection.getRecord (recordIndex).get().mCell))
|
||||||
|
{
|
||||||
std::pair<int, int> cellIndex = collection.getRecord (recordIndex).get().getCellIndex();
|
std::pair<int, int> cellIndex = collection.getRecord (recordIndex).get().getCellIndex();
|
||||||
|
|
||||||
/// \todo figure out worldspace (not important until multiple worldspaces are supported)
|
/// \todo figure out worldspace (not important until multiple worldspaces are supported)
|
||||||
|
@ -652,6 +654,7 @@ void CSVRender::Object::apply (CSMWorld::CommandMacro& commands)
|
||||||
commands.push (new CSMWorld::ModifyCommand (*model,
|
commands.push (new CSMWorld::ModifyCommand (*model,
|
||||||
model->index (recordIndex, column), QString::fromUtf8 (cellId.c_str())));
|
model->index (recordIndex, column), QString::fromUtf8 (cellId.c_str())));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mOverrideFlags & Override_Rotation)
|
if (mOverrideFlags & Override_Rotation)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue