[Patch] Hotbar fix for items and equipped slots

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
Rhas
Retired
Posts: 33
Joined: Sat May 29, 2010 11:39 am
Location: Kansas City

[Patch] Hotbar fix for items and equipped slots

Post by Rhas » Sat Jun 05, 2010 10:57 pm

Bug: Hotkey an item in your inventory or an item that is equipped and then camp. When you come back, equipped item hotkeys show only the primary slot and inventory items show no item.

Fix: This is happening because the spell_id field in the character_skillbar table is being ignored for item/equipped item hotkeys. For inventory items the spell_id field holds the item_id. For equipped items it holds the slot_id.

Here's the code diffs.

player.h - I added defines for the hotkey types that I figured out. I couldn't figure out what type 5 is.

Code: Select all

--- Player.h (rev 437)
+++ Player.h (working copy)
@@ -119,7 +119,10 @@
 	bool save_needed;
 };
 #define QUICKBAR_NORMAL		1
+#define QUICKBAR_INV_SLOT	2
+#define QUICKBAR_MACRO		3
 #define QUICKBAR_TEXT_CMD	4
+#define QUICKBAR_ITEM		6
 
 #define EXP_DISABLED_STATE	0
 #define EXP_ENABLED_STATE	1
client.cpp - only change here was to use the constant instead of a number. Not a fix, but better to maintain.

Code: Select all

--- client.cpp (rev 438)
+++ client.cpp (working copy)
@@ -1559,7 +1559,7 @@
 		if(type == 0xFFFFFFFF)
 			GetPlayer()->RemoveQuickbarItem(bar, slot);
 		else{
-			if(type == 1)
+			if(type == QUICKBAR_NORMAL)
 				spell =  master_spell_list.GetSpell(id, tier);
 			if(spell)
 				GetPlayer()->AddQuickbarItem(bar, slot, type, spell->GetSpellIcon(), spell->GetSpellIconType(), id, tier, 0, text.data.c_str());
WorldDatabase.cpp

Code: Select all

--- WorldDatabase.cpp (rev 441)
+++ WorldDatabase.cpp (working copy)
@@ -4024,10 +4024,10 @@
 		Spell* spell = master_spell_list.GetSpell(atoul(row[2]), tier);
 		if(spell)
 			client->GetPlayer()->AddQuickbarItem(atoul(row[5]), atoul(row[3]), atoul(row[1]), spell->GetSpellIcon(), spell->GetSpellIconType(), spell->GetSpellID(), spell->GetSpellTier(), atoul(row[0]), row[4], false);
-		else if(atoul(row[1]) == 3)
+		else if(atoul(row[1]) == QUICKBAR_MACRO)
 			client->GetPlayer()->AddQuickbarItem(atoul(row[5]), atoul(row[3]), atoul(row[1]), client->GetPlayer()->macro_icons[atoul(row[2])], 0xFFFF, atoul(row[2]), 0, atoul(row[0]), row[4], false);
 		else
-			client->GetPlayer()->AddQuickbarItem(atoul(row[5]), atoul(row[3]), atoul(row[1]), 0, 0, 0, 0, atoul(row[0]), row[4], false);
+			client->GetPlayer()->AddQuickbarItem(atoul(row[5]), atoul(row[3]), atoul(row[1]), 0, 0, atoul(row[2]), 0, atoul(row[0]), row[4], false);
 	}
 	if(query.GetErrorNumber())
 		LogFile->write(EQEMuLog::Error, "Error Loading Player Skillbar, Query: %s, Error: %s", query.GetQuery(), query.GetError());

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: [Patch] Hotbar fix for items and equipped slots

Post by Zcoretri » Sun Jun 06, 2010 10:20 am

Hotbar fix Added in :mrgreen:

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests