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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-25-2012, 05:00 AM
Taurinus2
Sarnak
 
Join Date: Nov 2009
Posts: 45
Default Fix

Code:
uint32 Bot::GetEquipmentColor(int8 material_slot) const
{
	//Bot tints
	int32 slotid = 0;
	uint32 returncolor = 0;
	uint32 botid = this->GetBotID();
	
	//Translate code slot # to DB slot #
	slotid = Inventory::CalcSlotFromMaterial(material_slot);

	//read from db
	char* Query = 0;
	MYSQL_RES* DatasetResult;
	MYSQL_ROW DataRow;
	
	if(database.RunQuery(Query, MakeAnyLenString(&Query, "SELECT color FROM botinventory WHERE BotID = %u AND SlotID = %u", botid, slotid), 0, &DatasetResult)) {
		if(mysql_num_rows(DatasetResult) == 1) {
			DataRow = mysql_fetch_row(DatasetResult);
			if(DataRow)
				returncolor = atoul(DataRow[0]); //atoi used here is wrong
		}
		mysql_free_result(DatasetResult);
		safe_delete_array(Query);
	}
	return returncolor;
}
See code and comment for details.
Reply With Quote
  #2  
Old 01-26-2012, 08:58 PM
Taurinus2
Sarnak
 
Join Date: Nov 2009
Posts: 45
Default

Some explanation:

What is happening is that the color of the armor is not being preserved when it is given to a bot. Everything ends up being without color.

Some pics to illustrate:

before:



after:



For reference, the bot is wearing Kizrak's armor.

With this change, the color shall be correctly preserved and the slots can still be tinted to your heart's desire.
Reply With Quote
Reply

Thread Tools
Display Modes

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 09:06 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 - 2026, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3