Skip to content

Commit

Permalink
Fix some logic errors
Browse files Browse the repository at this point in the history
  • Loading branch information
samp-incognito committed Nov 2, 2017
1 parent 2ecfb2a commit aca8a03
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/streamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,13 @@ void Streamer::processMapIcons(Player &player, const std::vector<SharedCell> &ce
}
for (std::multimap<std::pair<int, float>, Item::SharedMapIcon, Item::PairCompare>::iterator d = discoveredMapIcons.begin(); d != discoveredMapIcons.end(); ++d)
{
boost::unordered_map<int, int>::iterator i = player.internalMapIcons.find(d->second->mapIconID);
if (i != player.internalMapIcons.end())
{
continue;
}
if (player.internalMapIcons.size() == player.maxVisibleMapIcons)
{
boost::unordered_map<int, int>::iterator i = player.internalMapIcons.find(d->second->mapIconID);
if (i != player.internalMapIcons.end())
{
continue;
}
std::multimap<std::pair<int, float>, Item::SharedMapIcon, Item::PairCompare>::reverse_iterator e = existingMapIcons.rbegin();
if (e != existingMapIcons.rend())
{
Expand Down Expand Up @@ -1093,6 +1093,7 @@ void Streamer::streamMapIcons(Player &player, bool automatic)
boost::unordered_map<int, int>::iterator i = player.internalMapIcons.find(d->second.get<1>()->mapIconID);
if (i != player.internalMapIcons.end())
{
d = player.discoveredMapIcons.left.erase(d);
continue;
}
if (player.internalMapIcons.size() == player.maxVisibleMapIcons)
Expand Down Expand Up @@ -1422,6 +1423,7 @@ void Streamer::streamObjects(Player &player, bool automatic)
boost::unordered_map<int, int>::iterator i = player.internalObjects.find(d->second.get<1>()->objectID);
if (i != player.internalObjects.end())
{
d = player.discoveredObjects.left.erase(d);
continue;
}
int internalBaseID = INVALID_STREAMER_ID;
Expand Down Expand Up @@ -1902,6 +1904,7 @@ void Streamer::streamTextLabels(Player &player, bool automatic)
boost::unordered_map<int, int>::iterator i = player.internalTextLabels.find(d->second.get<1>()->textLabelID);
if (i != player.internalTextLabels.end())
{
d = player.discoveredTextLabels.left.erase(d);
continue;
}
if (player.internalTextLabels.size() == player.currentVisibleTextLabels)
Expand Down

0 comments on commit aca8a03

Please sign in to comment.