Support for running, installing or compiling OpenMW
- Site Admin
- Posts: 1193
- Joined: 05 Aug 2011, 22:21
- Location: Wroclaw, Poland
Hey, I have another one. I don't remember how I did it in older builds, but I was messing around with the console (F1) and I tried COCing to toddtest, no luck. I also tried to open the door at the top of the cavern, also, no luck AND CTD. Any ideas?
I got it! The destination is case sensitive.
Can't get to "mark's vampire test cell"
I would like to also suggest that you make coc's not case sensitive, I don't think there is an instance of using the same cell name twice with different cases.
Edit: Solved - This also was a problem with the case sensitive COC function.
Linux is case sensitive by default, so for cross-platform reasons, I argue that case sensitivity should stay.
I understand the reasons that it is this way, but it is annoying. There's a way to fix this. Converting the list of cells to all lowercase and converting anything typed in a coc command to lowercase would solve the problem pretty easily. All cells would be lowercase, so no exception would be thrown for typing coc toddtest instead of coc ToddTest because the program would see it as the same thing. Even coc ToDdTeSt would work.
I agree, that the case sensitivity has to go. I have taken care of this problem for pretty much everything but the cell names. Here the situation is a bit more complex, because the internal name is the same name as displayed to the user, so we can't simply smash case. We need a special case implementation. Not very hard, but I just did not get around to it yet.
The linux file system is case sensitive, true, but this has nothing to do with files. Making internal lookups (not just for cells, but all references) case insensitive is just a matter of how we are order our data structure.
In fact it would be a good idea to get this handled sooner rather than later, and it's not all that hard to do. I've added it to the roadmap for 0.09.
EDIT: didn't see your post Zini. In fact smashing case isn't always the best solution anyhow IMHO. Using a custom compare function for map<> that ignores case (I did this for the file finder) both solves the problem avoids lots of extra temporary allocations.
I adjusted the roadmap entry accordingly, because all names but cell names were case insensitive for ages.
Didn't see your edit either
A custom compare function might work as a general solution (and it is surely the right thing for the cell names). On the other hand it makes name-lookup a bit slower.
But that is premature optimisation. I only used the smash case implementation because I had to get the problem out of the way quickly for something else I was working on. I don't object to replacing my implementation with a general case-insensitive compare function. If later the profiling shows that it causes performance problems, we can still change it back for everything but cell names.
I say if it ain't broke don't fix it
Let's do a custom compare on cell names but keep the case smashing on the other lookups as it is, there doesn't seem to be any problems with it.