Ticket #3271: Fix.patch
File Fix.patch, 1.6 KB (added by , 9 years ago) |
---|
-
source/simulation2/components/CCmpRangeManager.cpp
1619 1619 { 1620 1620 PROFILE("UpdateVisibilityData"); 1621 1621 1622 // Calling UpdateVisibility can modify m_ModifiedEntities, so be careful: 1623 // infinite loops could be triggered by feedback between entities and their mirages. 1624 std::map<entity_id_t, u8> attempts; 1625 while (!m_ModifiedEntities.empty()) 1626 { 1627 entity_id_t ent = m_ModifiedEntities.back(); 1628 m_ModifiedEntities.pop_back(); 1629 1630 ++attempts[ent]; 1631 ENSURE(attempts[ent] < 100 && "Infinite loop in UpdateVisibilityData"); 1632 1633 UpdateVisibility(ent); 1634 } 1635 1622 1636 for (i32 n = 0; n < m_LosTilesPerSide * m_LosTilesPerSide; ++n) 1623 1637 { 1624 1638 for (player_id_t player = 1; player < MAX_LOS_PLAYER_ID + 1; ++player) … … 1634 1648 1635 1649 std::fill(m_GlobalPlayerVisibilityUpdate.begin(), m_GlobalPlayerVisibilityUpdate.end(), 0); 1636 1650 m_GlobalVisibilityUpdate = false; 1637 1638 // Calling UpdateVisibility can modify m_ModifiedEntities, so be careful:1639 // infinite loops could be triggered by feedback between entities and their mirages.1640 std::map<entity_id_t, u8> attempts;1641 while (!m_ModifiedEntities.empty())1642 {1643 entity_id_t ent = m_ModifiedEntities.back();1644 m_ModifiedEntities.pop_back();1645 1646 ++attempts[ent];1647 ENSURE(attempts[ent] < 100 && "Infinite loop in UpdateVisibilityData");1648 1649 UpdateVisibility(ent);1650 1651 } 1651 }1652 1652 1653 1653 virtual void RequestVisibilityUpdate(entity_id_t ent) 1654 1654 {