I'm playing around with an idea for "jobs" for SWR... Players can pick a profession and take employment. I decided the profession I would work out jobs first would be for bounty hunting: Every 25 minutes, the game cycles through each planet on the game, rolls to see if a new bounty will be added, and then if it rolls that one should be added, it'll go through every character in the game, and if it's a mob and is on the planet in question, along with some other criteria, it'll add add up to 10 mobs with matching criteria to an array. Then, if the game counted at least 1 mob while searching, it'll generate a bounty job by rolling between 0 and x, where x is the number of mobs it found, within 10.
Now... For some odd reason, CHAR_DATA is ending up in the array that can't be accessed, God knows why. Here's the code:
Moot point. Problem solved, I'm just a pinhead.
When I run it through GDB to see what's up, I get one of two culprits each time: One at the memory address 0x0, and one at 0x40de3, neither of which actually exist. My question is... Why is this passing the for() loop, and how can I make it NOT pass? For the most part, the code works fine, it's just when it hits one of those two memory addresses that it pukes. Any ideas?
And btw, sorry if this is the wrong board to put this, I wasn't sure if it would be appropriate or not.