mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-03 15:15:32 +00:00
[Client] Add exception handling to CellController::isSameCell()
This commit is contained in:
parent
3c4d78e496
commit
9c7f5410a5
1 changed files with 15 additions and 1 deletions
|
@ -439,7 +439,21 @@ bool CellController::isSameCell(const ESM::Cell& cell, const ESM::Cell& otherCel
|
|||
{
|
||||
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)
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue