Skip to content

Commit

Permalink
Fix logic errors
Browse files Browse the repository at this point in the history
That wouldn't have worked.
  • Loading branch information
samp-incognito committed Mar 30, 2017
1 parent e3ccb4f commit 205172d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/streamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,15 +887,15 @@ void Streamer::discoverMapIcons(Player &player, const std::vector<SharedCell> &c

void Streamer::streamMapIcons(Player &player, bool automatic)
{
if (++player.chunkTickCount[STREAMER_TYPE_MAP_ICON] >= player.chunkTickRate[STREAMER_TYPE_MAP_ICON] || !automatic)
if (!automatic || ++player.chunkTickCount[STREAMER_TYPE_MAP_ICON] >= player.chunkTickRate[STREAMER_TYPE_MAP_ICON])
{
std::size_t chunkCount = 0;
if (!player.removedMapIcons.empty())
{
std::vector<int>::iterator r = player.removedMapIcons.begin();
while (r != player.removedMapIcons.end())
{
if (++chunkCount > chunkSize[STREAMER_TYPE_MAP_ICON] || !automatic)
if (automatic && ++chunkCount > chunkSize[STREAMER_TYPE_MAP_ICON])
{
break;
}
Expand All @@ -922,7 +922,7 @@ void Streamer::streamMapIcons(Player &player, bool automatic)
std::multimap<std::pair<int, float>, Item::SharedMapIcon, Item::Compare>::iterator d = player.discoveredMapIcons.begin();
while (d != player.discoveredMapIcons.end())
{
if (++chunkCount > chunkSize[STREAMER_TYPE_MAP_ICON] || !automatic)
if (automatic && ++chunkCount > chunkSize[STREAMER_TYPE_MAP_ICON])
{
break;
}
Expand Down Expand Up @@ -1038,15 +1038,15 @@ void Streamer::discoverObjects(Player &player, const std::vector<SharedCell> &ce

void Streamer::streamObjects(Player &player, bool automatic)
{
if (++player.chunkTickCount[STREAMER_TYPE_OBJECT] >= player.chunkTickRate[STREAMER_TYPE_OBJECT] || !automatic)
if (!automatic || ++player.chunkTickCount[STREAMER_TYPE_OBJECT] >= player.chunkTickRate[STREAMER_TYPE_OBJECT])
{
std::size_t chunkCount = 0;
if (!player.removedObjects.empty())
{
std::vector<int>::iterator r = player.removedObjects.begin();
while (r != player.removedObjects.end())
{
if (++chunkCount > chunkSize[STREAMER_TYPE_OBJECT] || !automatic)
if (automatic && ++chunkCount > chunkSize[STREAMER_TYPE_OBJECT])
{
break;
}
Expand All @@ -1072,7 +1072,7 @@ void Streamer::streamObjects(Player &player, bool automatic)
std::multimap<std::pair<int, float>, Item::SharedObject, Item::Compare>::iterator d = player.discoveredObjects.begin();
while (d != player.discoveredObjects.end())
{
if (++chunkCount > chunkSize[STREAMER_TYPE_OBJECT] || !automatic)
if (automatic && ++chunkCount > chunkSize[STREAMER_TYPE_OBJECT])
{
break;
}
Expand Down Expand Up @@ -1381,15 +1381,15 @@ void Streamer::discoverTextLabels(Player &player, const std::vector<SharedCell>

void Streamer::streamTextLabels(Player &player, bool automatic)
{
if (++player.chunkTickCount[STREAMER_TYPE_3D_TEXT_LABEL] >= player.chunkTickRate[STREAMER_TYPE_3D_TEXT_LABEL] || !automatic)
if (!automatic || ++player.chunkTickCount[STREAMER_TYPE_3D_TEXT_LABEL] >= player.chunkTickRate[STREAMER_TYPE_3D_TEXT_LABEL])
{
std::size_t chunkCount = 0;
if (!player.removedTextLabels.empty())
{
std::vector<int>::iterator r = player.removedTextLabels.begin();
while (r != player.removedTextLabels.end())
{
if (++chunkCount > chunkSize[STREAMER_TYPE_3D_TEXT_LABEL] || !automatic)
if (automatic && ++chunkCount > chunkSize[STREAMER_TYPE_3D_TEXT_LABEL])
{
break;
}
Expand All @@ -1415,7 +1415,7 @@ void Streamer::streamTextLabels(Player &player, bool automatic)
std::multimap<std::pair<int, float>, Item::SharedTextLabel, Item::Compare>::iterator d = player.discoveredTextLabels.begin();
while (d != player.discoveredTextLabels.end())
{
if (++chunkCount > chunkSize[STREAMER_TYPE_3D_TEXT_LABEL] || !automatic)
if (automatic && ++chunkCount > chunkSize[STREAMER_TYPE_3D_TEXT_LABEL])
{
break;
}
Expand Down

0 comments on commit 205172d

Please sign in to comment.