msfraish / projecteqemu

Automatically exported from code.google.com/p/projecteqemu
0 stars 0 forks source link

Mysterious crash in EntityList::AIYellForHelp #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
EntityList::AIYellForHelp sometimes crashes and leaves a cryptic stack trace.  
Unsure of what causes it to crash.

Original issue reported on code.google.com by KimmySpr...@gmail.com on 2 May 2009 at 9:19

GoogleCodeExporter commented 8 years ago
I observed this crash on my server today.  Visual Studio broke here:
                if ( 
                         mob != sender 
                         && mob != attacker 
 //                      && !mob->IsCorpse() 
 //                      && mob->IsAIControlled() 
                         && mob->GetPrimaryFaction() != 0 
                         && mob->DistNoRoot(*sender) <= r 
                         && !mob->IsEngaged() 
                         ) 

The mob object in my case is not null but does have many variables that are at 
max 
value or the expression cannot be evaluated.  This usually means the mob is 
dead and 
iterating through this instance of the npc_list still has a pointer to it's 
object.

Possible solutions:
might not work on bad objects, but maybe unrem the check for !mob->IsCorpse()

Speed up the for loop to possibly get the checks in before it dies. My npc_list 
had 
312 objects in it so maybe moving the check (mob->DistNoRoot(*sender) <= r) up 
to 
the top of the if statement so the other processing checks aren't made on mob 
objects on the other side of the zone.

Original comment by cong...@gmail.com on 25 Jan 2010 at 7:07

GoogleCodeExporter commented 8 years ago
I believe this issue has been resolved a while back (by a suggestion from 
Rogean, I think).  Haven't seen this crash since then.

Original comment by weiss...@gmail.com on 2 Dec 2010 at 9:08

GoogleCodeExporter commented 8 years ago

Original comment by KimmySpr...@gmail.com on 2 Dec 2010 at 8:40