World Crash starting combat - double-click?

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

World Crash starting combat - double-click?

Post by John Adams » Sat Jul 27, 2013 12:52 am

Jab/Foof,

Noticed twice now when I double-clicked an Orc to attack, the world crashes here:

Code: Select all

 	ntdll.dll!774315de()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]	
>	EQ2World__Debug.exe!ZoneServer::CombatProcess() Line 958	C++
 	EQ2World__Debug.exe!ZoneServer::SpawnProcess() Line 1009	C++
 	EQ2World__Debug.exe!SpawnLoop(void * tmp) Line 4933	C++
 	EQ2World__Debug.exe!_callthreadstart() Line 255	C
 	EQ2World__Debug.exe!_threadstart(void * ptd) Line 239	C
 	kernel32.dll!765d33aa()	Unknown
 	ntdll.dll!77449ef2()	Unknown
 	ntdll.dll!77449ec5()	Unknown
Here: ((Entity*)itr->value)->ProcessCombat();

If I use the ~ or 1 buttons to attack, or click the hotbar, things seem okay.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: World Crash starting combat - double-click?

Post by John Adams » Sat Jul 27, 2013 3:13 pm

I think the problem is in this block of code -

Code: Select all

	if (target->HasTarget()) {
		if (target->IsPlayer() || (target->IsNPC() && target->IsPet() && !((NPC*)target)->GetOwner()->IsNPC())){
			Spawn* secondary_target = target->GetTarget();
			if (secondary_target->IsEntity()) {
				if (!secondary_target->IsPlayer()) {
					if (secondary_target->IsNPC()) {
						if (secondary_target->appearance.attackable) {
							if (!secondary_target->IsPet() || (secondary_target->IsPet() && ((NPC*)secondary_target)->GetOwner()->IsNPC())) {
								combat_target = secondary_target;
							}
						}
					}
				}
			}
		}
	}
	else
		combat_target = target;
			
	float distance = GetDistance(combat_target);
	distance -= combat_target->appearance.pos.collision_radius / 10;
	distance -= appearance.pos.collision_radius / 10;                            <-- crashed here this time
Double-click is definitely causing it, 100% reproducible.

I think it is because I do not have the spawn targetted, then double-click to target and attack, and BOOM.
combat_target.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: World Crash starting combat - double-click?

Post by xinux » Sat Jul 27, 2013 4:46 pm

Yup reproduceable every time
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: World Crash starting combat - double-click?

Post by John Adams » Sat Jul 27, 2013 4:47 pm

Trying this for now:

Code: Select all

	float distance = 0;
	if( combat_target )
	{
		distance = GetDistance(combat_target);
		distance -= combat_target->appearance.pos.collision_radius / 10;
		distance -= appearance.pos.collision_radius / 10;
	}

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: World Crash starting combat - double-click?

Post by Jabantiz » Sat Jul 27, 2013 4:49 pm

I'll see if I can look into this tonight, hopefully it will be a simple issue.

Also does right click attack result in the same behavior or is it just double left click?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: World Crash starting combat - double-click?

Post by John Adams » Sat Jul 27, 2013 5:02 pm

Jab, that code I added fixes the crash. And no, all other forms of attack seem to be fine. Right-click Attack, pressing Ranged, or Melee, or using the ` key.

It is only double-click.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: World Crash starting combat - double-click?

Post by Jabantiz » Sat Jul 27, 2013 5:33 pm

Well no surprise I can't reproduce it, works fine for me and checked the code don't have your changes, I am running on a local server not sure if it matters. Since your code fixes it will look into the wrong version crashing the world.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: World Crash starting combat - double-click?

Post by John Adams » Sat Jul 27, 2013 6:05 pm

I actually found this on my local server first, so no that isn't the issue. You can clearly see by my screen grab that the combat_target is invalid, no? That's why I changed what I did. Wasn't sure it was right, but if it passes your QA, I'm good with it.

I'm thinking the worse case is double-clicking something you are OOR on, the distance calcs will be wrong.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: World Crash starting combat - double-click?

Post by Jabantiz » Sat Jul 27, 2013 6:33 pm

yea combat_target is invalid in your pic. No clue why I don't have this issue and you and xinux do. oh well your fix should work.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests