Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-24-2015, 05:13 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default Zone Crash - If someone could test this

Someone with newer source, if you could test this for me. I am thinking it will also be a crash in the latest source, no changes in this section. This is how to repeat the crash, at least for me.

Go to Sirens Grotto and use Call of Karana on either a Seahorse or Swordfish. Send the pet to attack a few creatures. While they are attacking run back up to dry land, anywhere will do. Let the pet eventually die. Exactly when the pet dies I get a zone crash at what would be line 1037 on the latest souce in mob_ai.cpp

Code:
		if (target->IsCorpse())
		{
			RemoveFromHateList(this);
			return;
		}
Reply With Quote
  #2  
Old 12-24-2015, 06:20 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I can't test it atm..but, you could try this as a fix:
Code:
 zone/mob_ai.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp
index 79c4493..33df4e6 100644
--- a/zone/mob_ai.cpp
+++ b/zone/mob_ai.cpp
@@ -1031,6 +1031,9 @@ void Mob::AI_Process() {
 			}
 		}
 
+		if (target && !hate_list.IsEntOnHateList(target))
+			target = nullptr;
+
 		if (!target)
 			return;

EDIT: That's just above where you posted from

It's possible for the ai target timer to not be ready in the 'else' clause from above and the code will flow through with the last target..

..which, if already destroyed, will cause an exception error when you try to dereference the pointer - testing for target->IsCorpse()
__________________
Uleat of Bertoxxulous

Compilin' Dirty

Last edited by Uleat; 12-24-2015 at 06:46 PM..
Reply With Quote
  #3  
Old 12-24-2015, 06:48 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Added this above did fix it.

Code:
if (target && !hate_list.IsEntOnHateList(target))
			target = nullptr;
So what are we doing here? What is the current target causing the error? I am guessing it is the charmed underwater mob that just died? The question though is why it only seems to happen when the charmed mob is underwater and the client is not.

Either way I am very appreciative it is fixed but I would really like to know more about what the cause was. If I am going to continue to learn the source I have to dig my heels in.
Reply With Quote
  #4  
Old 12-24-2015, 06:59 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Yeah, this is not the source of the issue...

It can probably happen with any mob at any time when it's using the Mob::AI_Process()..but, you found a way to reliably trigger it.


Basically, any time a mob is removed from another mob's hate_list, we really need to test that mob's current target against what was removed.

Most reasons wouldn't crash a server..but, would cause erratic behavior between affected mobs.


Gimme a few and I'll see what I can do to fix it more permanently..
__________________
Uleat of Bertoxxulous

Compilin' Dirty

Last edited by Uleat; 12-24-2015 at 07:00 PM.. Reason: erotic != erratic...
Reply With Quote
  #5  
Old 12-24-2015, 07:12 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

I looked it over again and finally figured out what you were saying.

Quote:
It's possible for the ai target timer to not be ready in the 'else' clause from above and the code will flow through with the last target..
You are saying the timer on this line...

if(AItarget_check_timer->Check())

May would fail and fall through that if statement. Just curious, what about making that if statement into an if/else and making the target null in that else statement?
Reply With Quote
  #6  
Old 12-24-2015, 08:19 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

Oh, you don't want to make it null..I suspect there would be a lot of 'pauses' in-game if mobs didn't have targets during their 'off-time' :P
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #7  
Old 12-24-2015, 08:27 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

It 'looks' that the condition I would have added is already accounted for..
Code:
bool Mob::RemoveFromHateList(Mob* mob)
{
	SetRunAnimSpeed(0);
	bool bFound = false;
	if(IsEngaged())
	{
		bFound = hate_list.RemoveEntFromHateList(mob);
		if(hate_list.IsHateListEmpty())
		{
			AI_Event_NoLongerEngaged();
			zone->DelAggroMob();
			if (IsNPC() && !RuleB(Aggro, AllowTickPulling))
				ResetAssistCap();
		}
	}
	if(GetTarget() == mob)
	{
		SetTarget(hate_list.GetEntWithMostHateOnList(this));
	}

	return bFound;
}

I guess I'll have to check for direct manipulations of 'Mob::hate_list' to see if a GetTarget() check is made in those cases...
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #8  
Old 12-24-2015, 11:04 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Okay let me know what needs to be done on this. I definitely do not want to forget that it is just a temporary fix.
Reply With Quote
  #9  
Old 12-24-2015, 11:21 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I may push that as a 'temporary' fix at some point..I just hate the idea of iterating that list on every pass through there, though...
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #10  
Old 12-25-2015, 02:28 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Let me know if you do a permanent fix. Can you reply back to this post if you do?

I supposed I could instead catch it in the death event for a charmed mob.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:27 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3