{"action":"created","issue":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12800","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12800/labels{/name}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12800/comments","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12800/events","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/issues/12800","id":91595988,"number":12800,"title":"Some tilesets can't be loaded when PREFIX is defined","user":{"login":"akien-mga","id":4701338,"avatar_url":"https://avatars.githubusercontent.com/u/4701338?v=3","gravatar_id":"","url":"https://api.github.com/users/akien-mga","html_url":"https://github.com/akien-mga","followers_url":"https://api.github.com/users/akien-mga/followers","following_url":"https://api.github.com/users/akien-mga/following{/other_user}","gists_url":"https://api.github.com/users/akien-mga/gists{/gist_id}","starred_url":"https://api.github.com/users/akien-mga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akien-mga/subscriptions","organizations_url":"https://api.github.com/users/akien-mga/orgs","repos_url":"https://api.github.com/users/akien-mga/repos","events_url":"https://api.github.com/users/akien-mga/events{/privacy}","received_events_url":"https://api.github.com/users/akien-mga/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/labels/Build","name":"Build","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":28,"created_at":"2015-06-28T12:40:52Z","updated_at":"2015-08-01T15:53:26Z","closed_at":null,"body":"Hi there,\r\n\r\nI'm working on packaging Cataclysm DDA 0.C for Mageia, so I install it system-wide in the ```/usr``` prefix.\r\n\r\nIt's worth noting that I'm putting the game data in ```/usr/share/games/cataclysm-dda```, so I patched https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/path_info.cpp#L114 and https://github.com/CleverRaven/Cataclysm-DDA/blob/master/Makefile#L494 to add \"games/\" in the hardcoded path, but those changes should not trigger the issue I'm seeing.\r\n\r\nWhen selecting some tilesets (I'll give the list thereafter), I get:\r\n![ivc1](https://cloud.githubusercontent.com/assets/4701338/8396375/86ac0936-1da2-11e5-8ca2-e8d966b8922d.jpg)\r\n\r\nThe problematic tilesets are:\r\n* Blockhead's\r\n* Deon's\r\n* Hoder's\r\n* Thuztor'@\r\n* Tsu's\r\n\r\nAfter some digging in the code, I found that the problematic concatenation happens here:\r\nhttps://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/cata_tiles.cpp#L177-L179\r\n```FILENAMES[\"datadir\"]``` is ```/usr/share/games/cataclysm-dda/``` as expected, so the problem comes from the ```img_path```.\r\n\r\nLooking at the different tile_config.json files of the tilesets, it seems that:\r\n* The tilesets that are working define a relative \"file\" path, as in https://github.com/CleverRaven/Cataclysm-DDA/blob/master/gfx/RetroASCIITileset/tile_config.json#L11\r\n* The tilesets that do not work have no \"file\" path defined, so I guess the code generates an absolute file path based on the ```TILESET``` field in tileset.txt. See e.g. https://github.com/CleverRaven/Cataclysm-DDA/blob/master/gfx/HoderTileset/tile_config.json\r\n\r\nSo a workaround for this issue is to add a \"file\" path in all tileset_config.json files, but there might also be a better way to fix it in the code (e.g. by reviewing the path that generates the absolute file path to the tileset instead of a relative one).\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/23237067-some-tilesets-can-t-be-loaded-when-prefix-is-defined?utm_campaign=plugin&utm_content=tracker%2F146201&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F146201&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments/126931305","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/issues/12800#issuecomment-126931305","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12800","id":126931305,"user":{"login":"chaosvolt","id":11582235,"avatar_url":"https://avatars.githubusercontent.com/u/11582235?v=3","gravatar_id":"","url":"https://api.github.com/users/chaosvolt","html_url":"https://github.com/chaosvolt","followers_url":"https://api.github.com/users/chaosvolt/followers","following_url":"https://api.github.com/users/chaosvolt/following{/other_user}","gists_url":"https://api.github.com/users/chaosvolt/gists{/gist_id}","starred_url":"https://api.github.com/users/chaosvolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaosvolt/subscriptions","organizations_url":"https://api.github.com/users/chaosvolt/orgs","repos_url":"https://api.github.com/users/chaosvolt/repos","events_url":"https://api.github.com/users/chaosvolt/events{/privacy}","received_events_url":"https://api.github.com/users/chaosvolt/received_events","type":"User","site_admin":false},"created_at":"2015-08-01T15:53:26Z","updated_at":"2015-08-01T15:53:26Z","body":"Why am I always the last to notice these things? I'm hoping the Modded MShock is unaffected at least.\r\n\r\n> On a similar note, the tilesets should also be unaware of the name of the directory they live in -- if I want to rename \"MShock32TilesetModded\" to \"MyLittlePonySet\", that should be as simple as renaming the directory, period. It should most definitely not require me to go into its tile_config.json and its tileset.txt to do a search-and-replace.\r\n\r\nThat would be hilarious. I was tempted to rename the Modded MShock tilesets, but if I went with the obvious name (Chaosvolt's) that would push it into the default slot due to alphanumeric sorting. And unlike Chezzo, I'm a bit reluctant to do that. XP"}}