Jump to content
UPDATE 2 - External pictures are being replaced... ×
×
×
  • Create New...
  • 0

Stone Detector problem C++


Agorin

Question

When i have stack item detector i mean 27989 than after one used all items disappear 
here is the function:
 
	case 27989: // 영석감지기	case 76006: // 선물용 영석감지기	{	LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap(GetMapIndex());	if (pMap != NULL)	{	item->SetSocket(0, item->GetSocket(0) + 1);	FFindStone f;	// <Factor> SECTREE::for_each -> SECTREE::for_each_entity	pMap->for_each(f);	if (f.m_mapStone.size() > 0)	{	std::map<DWORD, LPCHARACTER>::iterator stone = f.m_mapStone.begin();	DWORD max = UINT_MAX;	LPCHARACTER pTarget = stone->second;	while (stone != f.m_mapStone.end())	{	DWORD dist = (DWORD)DISTANCE_SQRT(GetX()-stone->second->GetX(), GetY()-stone->second->GetY());	if (dist != 0 && max > dist)	{	max = dist;	pTarget = stone->second;	}	stone++;	}	if (pTarget != NULL)	{	int val = 3;	if (max < 10000) val = 2;	else if (max < 70000) val = 1;	ChatPacket(CHAT_TYPE_COMMAND, "StoneDetect %u %d %d", (DWORD)GetVID(), val,	(int)GetDegreeFromPositionXY(GetX(), pTarget->GetY(), pTarget->GetX(), GetY()));	}	else	{	ChatPacket(CHAT_TYPE_INFO, LC_TEXT("감지기를 작용하였으나 감지되는 영석이 없습니다."));	}	}	else	{	ChatPacket(CHAT_TYPE_INFO, LC_TEXT("감지기를 작용하였으나 감지되는 영석이 없습니다."));	}	if (item->GetSocket(0) >= 6)	{	ChatPacket(CHAT_TYPE_COMMAND, "StoneDetect %u 0 0", (DWORD)GetVID());	item->SetCount(item->GetCount() - 1);	}	}	break;
 
What i should change? I dont want disappear items stack
Link to comment
Share on other sites

  • Answers 0
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.