View Single Post
  #1  
Old 11-24-2008, 06:28 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Food/Drink Stats - Fixed

Tonight, I finally got around to looking into why food stats weren't adding to actual stats (shown in #showstats). It turns out that all of the code to calculate food was already there, but the code for calculating item bonuses wasn't allowing food/drink to work.

In bonuses.cpp around line 182, after this:
Code:
	if (!inst->IsEquipable(GetBaseRace(),GetClass()))
	{
Add this line:
Code:
		if ((!inst->GetItem()->ItemType == ItemTypeFood) && (!inst->GetItem()->ItemType == ItemTypeFood))

And that whole IF should look like this when you are done adding it:

Code:
	if (!inst->IsEquipable(GetBaseRace(),GetClass()))
	{
		if ((!inst->GetItem()->ItemType == ItemTypeFood) && (!inst->GetItem()->ItemType == ItemTypeFood))
			return;
	}
If anyone has any issues with this or thinks it may cause a problem or open possible exploits, let me know. I can't think of any. Also, if someone knows of a better way to write it that might be easier on the CPU, feel free to post it. Otherwise, I will get this added to SVN very soon. And, just in time for Thanksgiving too *WINK*
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote