Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:57 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3