1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 11:23:51 +00:00

[Client] Add exception handling to CellController::isSameCell()

This commit is contained in:
David Cernat 2020-08-27 16:31:29 +02:00
parent 3c4d78e496
commit 9c7f5410a5

View file

@ -439,7 +439,21 @@ bool CellController::isSameCell(const ESM::Cell& cell, const ESM::Cell& otherCel
{ {
if (&cell == nullptr || &otherCell == nullptr) return false; if (&cell == nullptr || &otherCell == nullptr) return false;
if (cell.isExterior() && otherCell.isExterior()) bool isCellExterior = false;
bool isOtherCellExterior = false;
try
{
isCellExterior = cell.isExterior();
isOtherCellExterior = otherCell.isExterior();
}
catch (std::exception& e)
{
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Failed cell comparison");
return false;
}
if (isCellExterior && isOtherCellExterior)
{ {
if (cell.mData.mX == otherCell.mData.mX && cell.mData.mY == otherCell.mData.mY) if (cell.mData.mX == otherCell.mData.mX && cell.mData.mY == otherCell.mData.mY)
return true; return true;