>Well, as I found out the hard way, this code won't ever be called. When >the violence loop is entered, if the code attempts to call the hit >procedure on a victim who is already dead, the system crashes. Shouldn't >then the afformentioned code exist somewhere much earlier? Perhaps in the >violence procedure itself? I'm not too sure, maybe this code does catch >something, but my debugging certainly would have been easier if that >syserr had actaully appeared in my syslog. To be perfectly blunt, it is up to the coder to do a sanity check any time there is a possibility one of the pointers used in a function about to be used has been NULLed. For example, in your multiple hit code (I have NO idea how you did it, but this is what you should do) just before the hit() is called (or any two_hit(), three_hit() or any routine that uses the *ch) and there is a possibility that the *ch has been killed, do a check. Otherwise, you will be a crashin' like nobody's business. I had the same problem implementing my multiple attacks. Of course, I am eventually to smash my combat system and build it from scratch, so that won't mean much ;) "One hundred years from now, none of this will matter because you and I will be dead -- unless the Grim Reaper has switched his record-keeping to a Windows 95-based system, in which case we all might live forever. " -- Associated Press +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST