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

bool tval_is_edible(const struct object *obj)


	switch (obj->tval) {

		case TV_FOOD:


			return true;


			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:

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