FS#13118 - [teeworlds] artwork missing in game because of a path problem
Attached to Project:
Community Packages
Opened by Xavier (shining) - Wednesday, 04 February 2009, 13:24 GMT
Last edited by Allan McRae (Allan) - Sunday, 22 February 2009, 09:02 GMT
Opened by Xavier (shining) - Wednesday, 04 February 2009, 13:24 GMT
Last edited by Allan McRae (Allan) - Sunday, 22 February 2009, 09:02 GMT
|
Details
From AUR comments :
"The graphics being messed up problem is probably a path problem. When run from /usr/share/teeworlds, the game runs fine. From any other directory, all the artwork is missing." |
This task depends upon
Closed by Allan McRae (Allan)
Sunday, 22 February 2009, 09:02 GMT
Reason for closing: Fixed
Additional comments about closing: teeworlds-0.5.1-2
Sunday, 22 February 2009, 09:02 GMT
Reason for closing: Fixed
Additional comments about closing: teeworlds-0.5.1-2
1) use provided data-dir override
2) use data-dir in PWD if present
3) use compiled-in data-dir if present
4) check for usable path in argv[0]
5) check for all default locations
The problem is that I reached 2) because I was running the game from $HOME, and I have a $HOME/data directory, which has nothing to do with teeworlds.
For most people, it should use point 5), because the hardcoded default locations are : "/usr/share/teeworlds", "/usr/local/share/teeworlds"
and the one we use is /usr/share/teeworlds.
So I can still launch the game properly with either 1) teeworlds -d /usr/share/teeworlds
or 2) cd /usr/share/teeworlds ; teeworlds
To be on the safe side, I would suggest to provide a launch script which do either of these two solutions, so that the game works even when you run it from a directory which contains a "data" directory.
And the patches were submitted upstream : http://www.freelists.org/post/teeworlds/PATCHES-Fix-datadir-search
I got a confirmation from teeworlds' developer on IRC that they will be applied in next version.
The main fix is to only use valid datadir by checking for the existence of the mapres dir inside.
Since the patches remove the need for a launcher script, if we want to fix this now, I think we should rather apply the patches. Also note that the data files now need to be installed to /usr/share/teeworlds/data (this is more consistent with the usage of the "data" directory in PWD), and this change should be needed with the next version anyway.
fix_datadir_search.patch (1 KiB)