World Crashes if GetSpawn() fails to find NPC

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 Crashes if GetSpawn() fails to find NPC

Post by John Adams » Sat Aug 27, 2011 5:02 pm

Scat,

Just (accidentally) found a crash bug we should fix. In Beggars Court, there is a ZoneScript w/Proximity for the "muffled_voices" if you recall. Well since that spawn was never captured by Collector, we had to manually create it in Tess to finish that quest.

Now, due to the repop of all our zones, "Muffled Voices" is again missing, but the proximity check was still there. In ZoneScripts/BeggarsCouter.lua:

Code: Select all

MuffledVoice = GetSpawn(Spawn, 1370123)
What happened was when I ran OUT of range, the world blew up.

Code: Select all

>	EQ2World__Debug.exe!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line)  Line 15	C++
 	EQ2World__Debug.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator[](unsigned int _Off)  Line 1441 + 0x14 bytes	C++
 	EQ2World__Debug.exe!ZoneServer::CheckLocationProximity()  Line 3455 + 0x1c bytes	C++
 	EQ2World__Debug.exe!ZoneServer::SpawnProcess()  Line 803	C++
 	EQ2World__Debug.exe!SpawnLoop(void * tmp)  Line 3984 + 0x8 bytes	C++
 	EQ2World__Debug.exe!_callthreadstart()  Line 259 + 0xf bytes	C
 	EQ2World__Debug.exe!_threadstart(void * ptd)  Line 243	C
 	kernel32.dll!7522339a() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	ntdll.dll!77389ed2() 	
 	ntdll.dll!77389ea5() 	

Seems to be eating it here:

Code: Select all

						if (!in_range) {
							if(lua_interface && prox->clients_in_proximity.count(client) > 0) {
==>>this line					lua_interface->RunZoneScript(zone_script, &prox->leaving_range_lua_function[0], this, client->GetPlayer());
								prox->clients_in_proximity.erase(client);
							}
						}

While I fixed it by simply adding the 1370123 spawn, anything that is a CRASH, I'd like to prevent.

Any ideas?

(btw, there is no "leaving" range event in the script)

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 Crashes if GetSpawn() fails to find NPC

Post by John Adams » Sat Aug 27, 2011 6:35 pm

UPDATE:
Just got the same crash again, only this time with no GetNPC() so I do not think the missing NPC was the cause, though in Beggars Court, it seemed to solve the problem making the spawn appear with that ID. Weird.

The second crash was GM Hall, with no NPCs in the script. Just proximities. when i left the range, it crashes world.

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: World Crashes if GetSpawn() fails to find NPC

Post by Scatman » Wed Aug 31, 2011 7:00 pm

Committed a potential fix.

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 Crashes if GetSpawn() fails to find NPC

Post by John Adams » Thu Sep 01, 2011 9:50 am

Scat is BACK! woot.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: World Crashes if GetSpawn() fails to find NPC

Post by Zcoretri » Thu Sep 01, 2011 11:25 pm

Welcome back scatty-man! :mrgreen:

Locked

Who is online

Users browsing this forum: No registered users and 0 guests