mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 22:15:32 +00:00
Fix frame listener errors for player markers
This commit is contained in:
parent
eebe1f156a
commit
3c4b74cd14
3 changed files with 12 additions and 4 deletions
|
@ -468,7 +468,7 @@ void DedicatedPlayer::updateMarker()
|
|||
|
||||
GUIController *gui = Main::get().getGUIController();
|
||||
|
||||
if (gui->mPlayerMarkers.isExistent(marker))
|
||||
if (gui->mPlayerMarkers.contains(marker))
|
||||
{
|
||||
gui->mPlayerMarkers.deleteMarker(marker);
|
||||
marker = gui->CreateMarker(guid);
|
||||
|
|
|
@ -73,7 +73,15 @@ size_t PlayerMarkerCollection::size() const
|
|||
return mMarkers.size();
|
||||
}
|
||||
|
||||
bool PlayerMarkerCollection::isExistent(const ESM::CustomMarker &marker)
|
||||
bool PlayerMarkerCollection::contains(const ESM::CustomMarker &marker)
|
||||
{
|
||||
return mMarkers.find(marker.mCell) != mMarkers.end();
|
||||
std::pair<ContainerType::iterator, ContainerType::iterator> range = mMarkers.equal_range(marker.mCell);
|
||||
|
||||
for (ContainerType::iterator it = range.first; it != range.second; ++it)
|
||||
{
|
||||
if (it->second == marker)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace mwmp
|
|||
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
||||
EventHandle_Void eventMarkersChanged;
|
||||
|
||||
bool isExistent(const ESM::CustomMarker &marker);
|
||||
bool contains(const ESM::CustomMarker &marker);
|
||||
private:
|
||||
ContainerType mMarkers;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue