Thread: Server crashes
View Single Post
  #15  
Old 03-24-2013, 02:12 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

I found the root cause of that crash:

The scenario is as follows: A client who is not a GM goes linkdead. The client leaves the group, leaving the merc as the leader. The merc, of course, will stay in the group until the client leaves the zone, however, it is now leader of a group it shouldn't be. There is a check on linkdead timeout that removes *and* depops the merc. The depop command should take care of the removal of the merc from the group, however, since the ID of the mercenary is 0 (which is set because the merc is the leader and the client is still technically in the group) it causes a crash due to the GetMerc() function returning NULL because of the ID of the merc.

To remedy this I have changed it to only call Depop() on merc instead. That will clean up the group properly and clean up the merc properly.

I will pull request a few areas that did this after I test it to make sure I didn't break anything else.
Reply With Quote