Page 1 of 1

Map issues?

Posted: Wed Jan 19, 2005 4:35 am
by wassup
First-chance exception at 0x01fd2590 (MQ2Map.dll) in eqgame.exe: 0xC0000005: Access violation reading location 0x00000118.

Stack:

Code: Select all

>	MQ2Map.dll!GenerateSpawnName(EQData::_SPAWNINFO * pSpawn=0x00000000, char * NameString=0x01ff6168)  Line 1268 + 0x11	C++
 	MQ2Map.dll!MapUpdate()  Line 741 + 0xd	C++
Disassembly:

Code: Select all

01FD258B  sub         edx,eax 
01FD258D  lea         ecx,[ecx] 
01FD2590  mov         cl,byte ptr [eax] <<<<<<<<<<<<<<<<<<<<<
01FD2592  mov         byte ptr [edx+eax],cl 
Code:

in mq2mapapi.cpp:

Code: Select all

case 'N':// cleaned up name 
strcpy(&Name[outpos],pSpawn->Name); <<<<<<<<<<<<<<<<
CleanupName(&Name[outpos],FALSE); 
outpos+=strlen(&Name[outpos]); 
break; 

Posted: Wed Jan 19, 2005 4:48 am
by dont_know_at_all
I only have about 1000 lines in my mq2mapapi.cpp file. How come yours says 1268?

Posted: Wed Jan 19, 2005 5:02 am
by wassup
I did do some of those mods from that person with the different shapes around the various pc types etc...

http://macroquest2.com/phpBB2/viewtopic ... sc&start=0

I have been using them for ages with no issues whatsoever though.

I unloaded MQ2FPS since I started using that again today since I have been using 3 characters on the same computer recently. No crash yet.

Will test further with MQ2FPS.

Posted: Wed Jan 19, 2005 10:31 am
by Cr4zyb4rd
Kinda hard for us to fix it if we have no clue what your code looks like. Do you have something like

Code: Select all

if (!pNewSpawn->SpawnID) return;
near the very top of your OnAddSpawn? Most of these errors were caused by "bad" spawns making it into the array.

Some spawns don't have a name, but AFAIK in all of those cases there SHOULD be a null there, and it looks like you're trying to address a zero pointer.

Posted: Wed Jan 19, 2005 11:02 am
by wassup
This is the code in OnAddSpawn in my MQ2Map:

Code: Select all

PLUGIN_API VOID OnAddSpawn(PSPAWNINFO pNewSpawn) 
{ 
   DebugSpewAlways("MQ2Map::OnAddSpawn(%s)",pNewSpawn->Name); 
   if (Update && pNewSpawn->SpawnID != 0) 
      AddSpawn(pNewSpawn); 
}

Posted: Wed Jan 19, 2005 11:11 am
by Cr4zyb4rd
I don't know what to tell you then, other than adding more if (!pSpawn) return; type checks at random places :/ Nothing should be passing null pointers though.