View Single Post
Old August 31, 2010, 12:20   #6
Hajo
Adept
 
Hajo's Avatar
 
Join Date: Aug 2010
Posts: 142
Hajo is on a distinguished road
I think I found the function. Looks a bit convoluted. Before hacking my way in the code I thought Angband would have much less special cases, but there are enough, still. On the other hand once one understood the logic it looks more reasonable. I'd assume that the code was state of the art when written, and it's just me who is not used to such code.

At the moment I think I do not need to adapt this place though.

I have a slightly off topic question: The number of 127 ego items seems to be limited through the use of a byte variable in the object_type structure for the link into the ego-item-date table. If I change that I assume I must also adapt game saving and loading routines. And somewhere the allocation of the e_info ego-item-data table (should have a define, IIRC). Is there more to it? It's not urgent, I think I have 20 ego-data slots left but if I continue modding Angband I sure run out of these slots, and maybe I'd better make the move early, if it alters the savegame structure.

On the other hand "unsigned char" seems to work reasonably well with gcc on all platforms that I know and it would already give a whopping 128 extra ego data slots, while keeping the save game format. A comment in types.h mentions that "unsigned char" is not properly supported on some platforms, but maybe this has improved in the past ten years?
__________________
I have a project problem? I have no project problem. I start a project, I work on it, it fails. No problem
Hajo is offline   Reply With Quote