|
|
|
@ -722,4 +722,27 @@ namespace MWWorld
|
|
|
|
|
|
|
|
|
|
return std::make_pair (stream.str(), created);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ESM::Cell *World::createRecord (const ESM::Cell& record)
|
|
|
|
|
{
|
|
|
|
|
if (record.data.flags & ESM::Cell::Interior)
|
|
|
|
|
{
|
|
|
|
|
if (mStore.cells.searchInt (record.name))
|
|
|
|
|
throw std::runtime_error ("failed creating interior cell");
|
|
|
|
|
|
|
|
|
|
ESM::Cell *cell = new ESM::Cell (record);
|
|
|
|
|
mStore.cells.intCells.insert (std::make_pair (record.name, cell));
|
|
|
|
|
return cell;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (mStore.cells.searchExt (record.data.gridX, record.data.gridY))
|
|
|
|
|
throw std::runtime_error ("failed creating exterior cell");
|
|
|
|
|
|
|
|
|
|
ESM::Cell *cell = new ESM::Cell (record);
|
|
|
|
|
mStore.cells.extCells.insert (
|
|
|
|
|
std::make_pair (std::make_pair (record.data.gridX, record.data.gridY), cell));
|
|
|
|
|
return cell;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|