{"action":"created","issue":{"url":"https://api.github.com/repos/endless-sky/endless-sky/issues/2420","repository_url":"https://api.github.com/repos/endless-sky/endless-sky","labels_url":"https://api.github.com/repos/endless-sky/endless-sky/issues/2420/labels{/name}","comments_url":"https://api.github.com/repos/endless-sky/endless-sky/issues/2420/comments","events_url":"https://api.github.com/repos/endless-sky/endless-sky/issues/2420/events","html_url":"https://github.com/endless-sky/endless-sky/issues/2420","id":222124695,"number":2420,"title":"bug: NPC::Load() ---> ship->FinishLoading() too early?","user":{"login":"EndrosG","id":26883037,"avatar_url":"https://avatars2.githubusercontent.com/u/26883037?v=3","gravatar_id":"","url":"https://api.github.com/users/EndrosG","html_url":"https://github.com/EndrosG","followers_url":"https://api.github.com/users/EndrosG/followers","following_url":"https://api.github.com/users/EndrosG/following{/other_user}","gists_url":"https://api.github.com/users/EndrosG/gists{/gist_id}","starred_url":"https://api.github.com/users/EndrosG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EndrosG/subscriptions","organizations_url":"https://api.github.com/users/EndrosG/orgs","repos_url":"https://api.github.com/users/EndrosG/repos","events_url":"https://api.github.com/users/EndrosG/events{/privacy}","received_events_url":"https://api.github.com/users/EndrosG/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-04-17T12:36:43Z","updated_at":"2017-04-19T18:44:09Z","closed_at":null,"body":"I have a mission definition with a NPC inside which uses a customized ship definition.\r\nThat ship has an outfit which is defined in a different file (damage_outfits.txt).\r\nBoth are in the same data/ folder of the same plugin.\r\n\r\n[damage_outfits.txt](https://github.com/endless-sky/endless-sky/files/925516/damage_outfits.txt)\r\n[testing_mission_hull_breach.txt](https://github.com/endless-sky/endless-sky/files/925517/testing_mission_hull_breach.txt)\r\n\r\nIf the outfit is not defined in the mission file but in the external outfit file, I get a soft error.\r\n> Unrecognized outfit in Freighter \"Broken Hull\"\r\n\r\nThe error does not show up, if the outfit in question is defined in the mission file. _That's the reason for the outfit definition with some XX in the name - for quick testing._\r\n\r\nAfter the mission had been offered to the player and became part of the savegame, I tested it again.\r\nThere was no error for the npc ship (inside a mission) in the savegame. Only for the ship in the mission definition file. I renamed the ship in the savegame to \"Almost Broken Hull\" for verification...\r\nIf I changed the outfit in the savegame to something unknown, I received (not surprisingly)\r\n> Unrecognized outfit in Freighter \"Broken Hull\"\r\n> Unrecognized outfit in Freighter \"Almost Broken Hull\"\r\n\r\nSo it seems that the ship->FinishLoading() is called too early for ships inside mission definitions (i.e. during NPC::Load)\r\n"},"comment":{"url":"https://api.github.com/repos/endless-sky/endless-sky/issues/comments/295385876","html_url":"https://github.com/endless-sky/endless-sky/issues/2420#issuecomment-295385876","issue_url":"https://api.github.com/repos/endless-sky/endless-sky/issues/2420","id":295385876,"user":{"login":"EndrosG","id":26883037,"avatar_url":"https://avatars2.githubusercontent.com/u/26883037?v=3","gravatar_id":"","url":"https://api.github.com/users/EndrosG","html_url":"https://github.com/EndrosG","followers_url":"https://api.github.com/users/EndrosG/followers","following_url":"https://api.github.com/users/EndrosG/following{/other_user}","gists_url":"https://api.github.com/users/EndrosG/gists{/gist_id}","starred_url":"https://api.github.com/users/EndrosG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EndrosG/subscriptions","organizations_url":"https://api.github.com/users/EndrosG/orgs","repos_url":"https://api.github.com/users/EndrosG/repos","events_url":"https://api.github.com/users/EndrosG/events{/privacy}","received_events_url":"https://api.github.com/users/EndrosG/received_events","type":"User","site_admin":false},"created_at":"2017-04-19T18:44:09Z","updated_at":"2017-04-19T18:44:09Z","body":"@Bladewood : I know, that the Kestrel file has that Unknown Ship Type definition. But since the terraforming asteroid is defined \"inline\", I never thought that inline definitions were *not* supposed to be used in mission definitions.\r\n\r\nBut it's absolutely okay for me if this issue get's a `wontfix` label assigned."}}
{"actor":{"display_login":"EndrosG"}}