I'm posting this here, because I'm thinking this is something that would prove difficult on any codebase. However, I'm using it on an SWR (heavily-heavily modified) with most of the FUSS fixes applied.
I am writing a skill called checkmicrophone. Basically, it checks a players inventory for microphones and then returns the number to the player.
I'm using this for check to search through their things.
for ( obj = victim->last_carrying; obj; obj = obj->prev_content )
Below is a series of if checks for item types. For instance, if it's a container - it checks its contents as well.
The problem I'm having is that if objects are stacked - whether in the inventory or in a container - if only shows up as 1. Is there a better way to do this? Am I doing something wrong?