Problem with structs and functions

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Taliesen
Posts: 17
Joined: Fri Apr 22, 2005 7:39 am

Post by Taliesen »

Thank you all for your help, I now have it working. I found a couple of problems in the source. The first was a problem with the way I was calling the Tribes[] array like was already pointed out, I changed a lot of that code and it now cycles through every member of the array. Then because of the way my random function was set up, all of the members were getting the same value sent back for rand because the cpu was doing the enitre program in less then a milisecond so all of the array members used the same seed. I fixed that by declaring my rand() function in main to initilize it and in probability it was no longer based on the clock every time. It works, so I am not complaining, if anyone would like to see the source code, let me know.
Taliesen
Posts: 17
Joined: Fri Apr 22, 2005 7:39 am

Post by Taliesen »

Thank you all for your help, I now have it working. I found a couple of problems in the source. The first was a problem with the way I was calling the Tribes[] array like was already pointed out, I changed a lot of that code and it now cycles through every member of the array. Then because of the way my random function was set up, all of the members were getting the same value sent back for rand because the cpu was doing the enitre program in less then a milisecond so all of the array members used the same seed. I fixed that by declaring my rand() function in main to initilize it and in probability it was no longer based on the clock every time. It works, so I am not complaining, if anyone would like to see the source code, let me know.
Post Reply