is the random value an integer? have a look at the function see what values it can return, you say when someone needs a spawn point? is it only then that its crashing?
----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 10:59 AM Subject: [hlcoders] Crash bug that I can not solve! I have nearly reached my own end with this bug. I can not solve it for the life of me. Every so often my game freezes. It sort of hangs, and the server has to be restarted. If I compile a debug version and run the server in the debugger and wait for a crash, I will get an assertion error _BLOCK_TYPE_IS_VALID_(pHead->nBlockUse). So I google searched that error and I found a few causes which make some sense. One of them was running outside the bounds of an array. I assume that's a global array which is in the heap, not the stack. I also read that the error can occur when dynamically allocated memory gets deleted twice. This would seem the more likely case in my situation. However the weird part is the crash only occurs "sometimes". I have tried for 3 weeks to repeat it or look for a patterns with very little luck. I have managed to isolate the crash to one particular function which deletes a bunch of dynamically allocated memory. However, like I said, most of the time, it works. Some times it crashes. About 1/20 crashes. The code where the crash occurs is very simple. I am simply deleting a linked list I created previously. In no place in my code were the pointers to my memory changed, nor were any new pointers assigned to the same block of memory via = assignment operator. It's a cut and dry case and this is why I'm dumbfounded. I have gone to the extreme of making a file dump and outputting commands during the execution of the game. This is how I found out where the crash occurred. The last output was entering this function. So it crashes somewhere in that function. I'll just go ahead and post the function and see if anyone else can make sense of it. What I have done is redone the spawn code. I load all the spawn points from a map into a list and the get a random number from 0-X where X is the amount of spawn points -1 and return that spawn point when someone needs a random one= _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders