View Single Post
  #4  
Old 02-18-2009, 08:31 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Unfortunately, I just had to back out of the fix I put in for Drakkin to be able to use equipment and weapons and gain stats from them. It was working great for SoF, but the fix caused the same problem to start happening in Titanium. So, right now, it seems like only 1 or the other can work. I am sure there is a way to let both work properly, but I just don't know of a good solution right now. If anyone has a suggestion, it would help

Here is the piece of code that needs to be changed to work with both client versions:

/common/item.cpp
Code:
bool ItemInst::IsEquipable(int16 race, int16 class_) const
{
	if (!m_item)
		return false;
	
	bool israce = false;
	bool isclass = false;
	
	if (m_item->Slots == 0) {
		return false;
	}
	
	uint32 classes_ = m_item->Classes;
	uint32 races_ = m_item->Races;
	int32 race_ = 0;
	#ifndef PACKETCOLLECTOR
	race_ = GetArrayRace(race);
	#endif

	race_ = (race_==17? 15 : race_); // For SoF this should be: race_ = (race_==18? 16 : race_);
	// @merth: can this be optimized?  i.e., will (race & common->Races) suffice?
	for (int cur_class = 1; cur_class<=PLAYER_CLASS_COUNT; cur_class++) {
		if (classes_ % 2 == 1) {
    		if (cur_class == class_) {
    			isclass = true;
				break;
			}
		}
		classes_ >>= 1;
	}
	for (unsigned int cur_race = 1; cur_race <= PLAYER_RACE_COUNT; cur_race++) {
		
		if (races_ % 2 == 1) {
    		if (cur_race == race_) {
    			israce = true;
				break;
   			}
		}
		races_ >>= 1;
	}
	return (israce && isclass);
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote