mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-28 08:09:39 +00:00
[Client] Fix crash by not trying to enable markers for invalid players
This commit is contained in:
parent
78a9a428a6
commit
3e1c96a49c
2 changed files with 5 additions and 0 deletions
|
@ -358,6 +358,8 @@ MWWorld::CellStore *CellController::getCellStore(const ESM::Cell& cell)
|
|||
|
||||
bool CellController::isSameCell(const ESM::Cell& cell, const ESM::Cell& otherCell)
|
||||
{
|
||||
if (&cell == nullptr || &otherCell == nullptr) return false;
|
||||
|
||||
if (cell.isExterior() && otherCell.isExterior())
|
||||
{
|
||||
if (cell.mData.mX == otherCell.mData.mX && cell.mData.mY == otherCell.mData.mY)
|
||||
|
|
|
@ -96,6 +96,9 @@ void PlayerList::enableMarkers(const ESM::Cell& cell)
|
|||
{
|
||||
for (auto &playerEntry : players)
|
||||
{
|
||||
if (playerEntry.second == nullptr || playerEntry.second->getPtr().mRef == nullptr)
|
||||
continue;
|
||||
|
||||
if (Main::get().getCellController()->isSameCell(cell, playerEntry.second->cell))
|
||||
{
|
||||
playerEntry.second->enableMarker();
|
||||
|
|
Loading…
Reference in a new issue