
This probably meant to do "res_conf.type" instead of "type". The latter is a function reference, and will always compare unequal to those strings.
But my resources are still getting their richness modded somehow. And fixing this might end up applying the richness modifier twice. I don't understand that part of things.