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
Task Type Bug Report
Category
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

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
Comment by Xavier (shining) - Wednesday, 04 February 2009, 13:44 GMT
Ah, that is a funny one. teeworlds has the following logic to detect the data path :
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.
Comment by Xavier (shining) - Wednesday, 04 February 2009, 13:46 GMT Comment by Allan McRae (Allan) - Friday, 06 February 2009, 08:48 GMT
Wow... #2 is fairly stupid. I will add a launcher script on the next update (or perhaps earlier if I feel like closing bugs...)
Comment by Xavier (shining) - Friday, 06 February 2009, 12:59 GMT
This problem was found and fixed by gentoo : https://bugs.gentoo.org/attachment.cgi?id=180630&action=view
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.

Loading...