Page 1 of 1

World Crashes if GetSpawn() fails to find NPC

Posted: Sat Aug 27, 2011 5:02 pm
by John Adams
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)

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

Posted: Sat Aug 27, 2011 6:35 pm
by John Adams
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.

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

Posted: Wed Aug 31, 2011 7:00 pm
by Scatman
Committed a potential fix.

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

Posted: Thu Sep 01, 2011 9:50 am
by John Adams
Scat is BACK! woot.

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

Posted: Thu Sep 01, 2011 11:25 pm
by Zcoretri
Welcome back scatty-man! :mrgreen: