View Single Post
  #2  
Old 04-27-2014, 03:55 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

It is returning once it finds the first one. So it is working as intended.


entity.cpp line 856
Code:
NPC *EntityList::GetNPCByNPCTypeID(uint32 npc_id)
{
	if (npc_id == 0 || npc_list.empty())
		return nullptr;

	auto it = npc_list.begin();
	while (it != npc_list.end()) {
		if (it->second->GetNPCTypeID() == npc_id)
			return it->second;
		++it;
	}

	return nullptr;
}
Reply With Quote