private void CheckFavoriteBuildings() { if (m_favoriteBuildings == null) { return; } int templId = 0; if (m_workplace != Guid.Empty) { templId = M_BuildingManager.SGetTemplIdFromBuilding(m_workplace); } for (int i = 0; i < m_favoriteBuildings.Count; i++) { FavoriteBuilding fav = m_favoriteBuildings[i]; if (!fav.active && fav.buildingTemplId == templId) { fav.active = true; fav.currentDays = 0; fav.currentMood = 0; } else if (fav.active && fav.buildingTemplId != templId) { fav.active = false; fav.currentMood = 0; } } }