Jump to content
  • Advertisement
Sign in to follow this  
Efe

DX8 Sdk Region Error.

This topic is 2532 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[font="Verdana"]This code giving close error @
rx<0 || rz<0 || rx>=m_nXRegion || rz>=m_nZRegion

RegionNpcAdd(int rx, int rz, int nid) ' this using add monster to map, x coor, y coor and nid ( monster or npc id )
why to error?[/font]
void C3DMap::RegionNpcAdd(int rx, int rz, int nid)
{
if( rx<0 || rz<0 || rx>=m_nXRegion || rz>=m_nZRegion )
return;

int *pInt = NULL;

EnterCriticalSection( &g_region_critical );

pInt = new int;
*pInt = nid;
m_ppRegion[rx][rz].m_RegionNpcArray.PutData( nid, pInt );

LeaveCriticalSection( &g_region_critical );
}



[font="Verdana"]And its npc and monster remove it's work successfully.[/font]


Iterator C3DMap::RegionNpcRemove(int rx, int rz, int nid)
{
if( rx<0 || rz<0 || rx>=m_nXRegion || rz>=m_nZRegion )
return FALSE;

CRegion *region = NULL;
map < int, int* >::iterator Iter;

EnterCriticalSection( &g_region_critical );

region = &m_ppRegion[rx][rz];
Iter = region->m_RegionNpcArray.DeleteData( nid );

LeaveCriticalSection( &g_region_critical );

return Iter;
}



[font="Verdana"]sorry my poor english.[/font]

Share this post


Link to post
Share on other sites
Advertisement
i dont see why that s causeing the error.

what about entering the criticle section before doing any locations.

maybe add ('s and )'s to you logic.
:) :) ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!