Thread: list-tvals.h
View Single Post
Old November 5, 2019, 15:36   #4
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,179
wobbly is on a distinguished road
So I may not have been exactly clear in the above post. The code has a bunch of this:

Code:
bool tval_is_edible(const struct object *obj)

{

	switch (obj->tval) {

		case TV_FOOD:

		case TV_MUSHROOM:

			return true;

		default:

			return false;

	}

}
There's not much point adding a new object type in object_base unless you can specify edible etc. in object_base.

It's also got a bunch of this:

Code:
else if (tval_is_edible(obj1) || tval_is_potion(obj1) ||

		tval_is_scroll(obj1) || tval_is_rod(obj1)) {

		/* Food, potions, scrolls and rods all stack nicely,

		   since the kinds are identical, either both will be

		   aware or both will be unaware */
that's a small snipet. If it's addable outside the code that needs to be more like:

if stackable {

Note I'm not particularly suggesting doing it that way. It just seems to me that list-tvals.h isn't the only thing that has to change to put types editable in the edit files.
wobbly is offline   Reply With Quote