On Sun, 18 Mar 2001, Peter Ajamian wrote: >You forgot to check extractions_pending before looping through the entire >player base (you check for an invlid value but you don't check to see if >it's set). I didn't forget, check the for(; XXX ;) condition. >Also, I would move the validity test to right before you extract the >character. Test for 0 there, not -1, then you can make >extractions_pending unsigned (and effectively double its capacity). See >below... I didn't want to. How can you tell whether 4.2 billion is a valid value or an error? Ok, that's longer than the character_list so you might know based on that, but then is 5 an error? With a negative number it's easy to know it's not supposed to be that. The loop itself will also never let the number go negative so I don't need to check there. I think if you have 2.1 billion characters getting extracted in the same 1/10th of a second you have quite a few problems besides this code. You'll get the error message, but it'll still extract everybody properly so there's nothing wrong that'll stick around. >+ if (extractions_pending) >+ log("SYSERR: %d less extractions than extractions_pending", >extractions_pending); This I could probably do, except I'll need to check for '>= 0' so I don't warn twice for the same error (or at least try not to). -- George Greer | If it's about the CircleMUD mailing list, greerga@circlemud.org | mail owner-circle@post.queensu.ca instead. -- +---------------------------------------------------------------+ | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html | +---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/04/01 PST