View Single Post
Old April 21, 2009, 20:54   #4
takkaria's Avatar
Join Date: Apr 2007
Posts: 1,941
Donated: $40
takkaria is on a distinguished road
Originally Posted by PaulBlay View Post
command_cmd of the player_type structure is s16b, but as far as I can tell it is never assigned values outside of the char range. Is more expected from command_cmd in the future?

As it is there are places, like

	/* Check for a "prevention" inscription */
	verify_inscrip[1] = p_ptr->command_cmd;
where I'm not sure if it is safe, or appropriate, to 'cast' p_ptr->command_cmd to (char) or not. I've been going through my (mostly your ;-) code
I disclaim responsibility for the vast majority of Angband.

tweaking it to remove compiler warnings
What compiler are you using?

and this is one of the few left. I don't want to cast stuff unless I'm pretty sure the RHS is really not going to exceed the cast specified.
Looks like it's a fairly safe cast to make, yeah, but I have no exhaustive answer you for since I've not really looked at it and it involves inkey(), which I avoid like the plague.

[EDIT] Incidentally I think it would be nice if you could make a clean break between 'key pressed' and 'command action'. You could make macros and keymappings easier to read and more flexible for a start.
Yup, it would, and is somewhat slowly being worked on.
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote