1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-01-15 23:00:54 +00:00

Remove logically redundant code

This commit is contained in:
Evil Eye 2025-09-08 18:12:05 +02:00
parent e7fbb3e33c
commit d148ccbb93
5 changed files with 1 additions and 22 deletions

View file

@ -635,7 +635,6 @@ namespace MWGui
mSpellBox->setUserData(MyGUI::Any::Null);
mActiveCell = nullptr;
mHasALastActiveCell = false;
}
void HUD::customMarkerCreated(MyGUI::Widget* marker)

View file

@ -394,8 +394,7 @@ namespace MWGui
mExteriorDoorMarkerWidgets.clear();
for (auto& [coord, doors] : mExteriorDoorsByCell)
{
if (!mHasALastActiveCell || !mGrid.inside({ coord.first, coord.second })
|| activeGrid.inside({ coord.first, coord.second }))
if (!mGrid.inside({ coord.first, coord.second }) || activeGrid.inside({ coord.first, coord.second }))
{
mDoorMarkersToRecycle.insert(mDoorMarkersToRecycle.end(), doors.begin(), doors.end());
doors.clear();
@ -406,15 +405,6 @@ namespace MWGui
for (auto& widget : mDoorMarkersToRecycle)
widget->setVisible(false);
if (mHasALastActiveCell)
{
for (const auto& entry : mMaps)
{
if (!mGrid.inside({ entry.mCellX, entry.mCellY }))
mLocalMapRender->removeExteriorCell(entry.mCellX, entry.mCellY);
}
}
}
else
mGrid = mLocalMapRender->getInteriorGrid();
@ -463,9 +453,6 @@ namespace MWGui
for (MyGUI::Widget* widget : currentDoorMarkersWidgets())
widget->setCoord(getMarkerCoordinates(widget, 8));
if (mActiveCell->isExterior())
mHasALastActiveCell = true;
updateMagicMarkers();
updateCustomMarkers();
}

View file

@ -119,7 +119,6 @@ namespace MWGui
MyGUI::ScrollView* mLocalMap = nullptr;
MyGUI::ImageBox* mCompass = nullptr;
float mLocalMapZoom = 1.f;
bool mHasALastActiveCell = false;
bool mFogOfWarToggled = true;
bool mFogOfWarEnabled;
bool mNeedDoorMarkersUpdate = false;

View file

@ -205,11 +205,6 @@ namespace MWRender
std::make_pair(cell->getCell()->getGridX(), cell->getCell()->getGridY()), MapSegment{});
}
void LocalMap::removeExteriorCell(int x, int y)
{
mExteriorSegments.erase({ x, y });
}
void LocalMap::removeCell(MWWorld::CellStore* cell)
{
saveFogOfWar(cell);

View file

@ -55,7 +55,6 @@ namespace MWRender
void requestMap(const MWWorld::CellStore* cell);
void addCell(MWWorld::CellStore* cell);
void removeExteriorCell(int x, int y);
void removeCell(MWWorld::CellStore* cell);