{"action":"created","issue":{"url":"https://api.github.com/repos/earalov/Skylines-IsolatedFailures/issues/1","labels_url":"https://api.github.com/repos/earalov/Skylines-IsolatedFailures/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/earalov/Skylines-IsolatedFailures/issues/1/comments","events_url":"https://api.github.com/repos/earalov/Skylines-IsolatedFailures/issues/1/events","html_url":"https://github.com/earalov/Skylines-IsolatedFailures/issues/1","id":103943548,"number":1,"title":"Broken save fixing discussion","user":{"login":"earalov","id":11718481,"avatar_url":"https://avatars.githubusercontent.com/u/11718481?v=3","gravatar_id":"","url":"https://api.github.com/users/earalov","html_url":"https://github.com/earalov","followers_url":"https://api.github.com/users/earalov/followers","following_url":"https://api.github.com/users/earalov/following{/other_user}","gists_url":"https://api.github.com/users/earalov/gists{/gist_id}","starred_url":"https://api.github.com/users/earalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earalov/subscriptions","organizations_url":"https://api.github.com/users/earalov/orgs","repos_url":"https://api.github.com/users/earalov/repos","events_url":"https://api.github.com/users/earalov/events{/privacy}","received_events_url":"https://api.github.com/users/earalov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"SamsamTS","id":2388532,"avatar_url":"https://avatars.githubusercontent.com/u/2388532?v=3","gravatar_id":"","url":"https://api.github.com/users/SamsamTS","html_url":"https://github.com/SamsamTS","followers_url":"https://api.github.com/users/SamsamTS/followers","following_url":"https://api.github.com/users/SamsamTS/following{/other_user}","gists_url":"https://api.github.com/users/SamsamTS/gists{/gist_id}","starred_url":"https://api.github.com/users/SamsamTS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamsamTS/subscriptions","organizations_url":"https://api.github.com/users/SamsamTS/orgs","repos_url":"https://api.github.com/users/SamsamTS/repos","events_url":"https://api.github.com/users/SamsamTS/events{/privacy}","received_events_url":"https://api.github.com/users/SamsamTS/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-08-30T20:15:53Z","updated_at":"2015-08-30T21:00:34Z","closed_at":null,"body":"Looks like citizens need to be fixed too\r\n```java\r\n        private static void FixBrokenCitizens()\r\n        {\r\n            var brokenCount = 0;\r\n\r\n            // Fix broken citizens\r\n            Array16<CitizenInstance> instances = Singleton<CitizenManager>.instance.m_instances;\r\n            for (int i = 0; i < instances.m_size; i++)\r\n            {\r\n\r\n                if (instances.m_buffer[i].m_targetBuilding >= 0 && instances.m_buffer[i].m_targetBuilding < BuildingManager.MAX_BUILDING_COUNT)\r\n\r\n                    if (BuildingManager.instance.m_buildings.m_buffer[instances.m_buffer[i].m_targetBuilding].Info ==\r\n                        null)\r\n                    {\r\n                        try\r\n                        {\r\n                            instances.m_buffer[i].m_targetBuilding = 0;\r\n                            brokenCount++;\r\n                        }\r\n                        catch (Exception e)\r\n                        {\r\n                            UnityEngine.Debug.LogException(e);\r\n                        }\r\n                    }\r\n                if (BuildingManager.instance.m_buildings.m_buffer[instances.m_buffer[i].m_sourceBuilding].Info == null)\r\n                {\r\n                    try\r\n                    {\r\n                        instances.m_buffer[i].m_sourceBuilding = 0;\r\n                        brokenCount++;\r\n                    }\r\n                    catch (Exception e)\r\n                    {\r\n                        UnityEngine.Debug.LogException(e);\r\n                    }\r\n                }\r\n            }\r\n\r\n\r\n            if (brokenCount > 0) UnityEngine.Debug.Log(\"Removed \" + brokenCount + \" broken citizen instances.\");\r\n        }\r\n```\r\nBy adding this code I get rid of simulation errors related to citizens"},"comment":{"url":"https://api.github.com/repos/earalov/Skylines-IsolatedFailures/issues/comments/136190825","html_url":"https://github.com/earalov/Skylines-IsolatedFailures/issues/1#issuecomment-136190825","issue_url":"https://api.github.com/repos/earalov/Skylines-IsolatedFailures/issues/1","id":136190825,"user":{"login":"earalov","id":11718481,"avatar_url":"https://avatars.githubusercontent.com/u/11718481?v=3","gravatar_id":"","url":"https://api.github.com/users/earalov","html_url":"https://github.com/earalov","followers_url":"https://api.github.com/users/earalov/followers","following_url":"https://api.github.com/users/earalov/following{/other_user}","gists_url":"https://api.github.com/users/earalov/gists{/gist_id}","starred_url":"https://api.github.com/users/earalov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earalov/subscriptions","organizations_url":"https://api.github.com/users/earalov/orgs","repos_url":"https://api.github.com/users/earalov/repos","events_url":"https://api.github.com/users/earalov/events{/privacy}","received_events_url":"https://api.github.com/users/earalov/received_events","type":"User","site_admin":false},"created_at":"2015-08-30T21:00:34Z","updated_at":"2015-08-30T21:00:34Z","body":"Test methodology: no custom assets, no mods (other than the fixer mod)"}}