rendered paste bodyIndex: trunk/src/game/ItemHandler.cpp
===================================================================
--- trunk/src/game/ItemHandler.cpp (revision 84)
+++ trunk/src/game/ItemHandler.cpp (working copy)
@@ -217,10 +217,7 @@
WorldPacket data( SMSG_ITEM_QUERY_SINGLE_RESPONSE, 600);
data << pProto->ItemId;
data << pProto->Class;
-
- // client known only 0 subclass (and 1-2 obsolete subclasses)
- data << uint32(pProto->Class==ITEM_CLASS_CONSUMABLE && pProto->SubClass==ITEM_SUBCLASS_COMBAT_EFFECT ? 0 : pProto->SubClass);
-
+ data << pProto->SubClass;
data << uint32(-1); // new 2.0.3, not exist in wdb cache?
data << Name;
data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name...
Index: trunk/src/game/ItemPrototype.h
===================================================================
--- trunk/src/game/ItemPrototype.h (revision 84)
+++ trunk/src/game/ItemPrototype.h (working copy)
@@ -228,11 +228,10 @@
ITEM_SUBCLASS_FOOD = 5,
ITEM_SUBCLASS_ITEM_ENHANCEMENT = 6,
ITEM_SUBCLASS_BANDAGE = 7,
- ITEM_SUBCLASS_CONSUMABLE_OTHER = 8,
- ITEM_SUBCLASS_COMBAT_EFFECT = 9 // Mangos Custom
+ ITEM_SUBCLASS_CONSUMABLE_OTHER = 8
};
-#define MAX_ITEM_SUBCLASS_CONSUMABLE 10
+#define MAX_ITEM_SUBCLASS_CONSUMABLE 9
enum ItemSubclassContainer
{
Index: trunk/src/game/SpellHandler.cpp
===================================================================
--- trunk/src/game/SpellHandler.cpp (revision 84)
+++ trunk/src/game/SpellHandler.cpp (working copy)
@@ -32,7 +32,7 @@
void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
{
// TODO: add targets.read() check
- CHECK_PACKET_SIZE(recvPacket,1+1+4);
+ CHECK_PACKET_SIZE(recvPacket,1+1+2);
sLog.outDetail("WORLD: CMSG_USE_ITEM packet, data length = %i",recvPacket.size());
@@ -64,21 +64,22 @@
return;
}
- if (pUser->isInCombat())
+ if(pUser->isInCombat())
{
- uint8 consumable = proto->Class == ITEM_CLASS_CONSUMABLE &&
- proto->SubClass != ITEM_SUBCLASS_POTION &&
- proto->SubClass != ITEM_SUBCLASS_SCROLL &&
- proto->SubClass != ITEM_SUBCLASS_BANDAGE &&
- proto->SubClass != ITEM_SUBCLASS_ITEM_ENHANCEMENT &&
- proto->SubClass != ITEM_SUBCLASS_COMBAT_EFFECT;
+ for(int i = 0; i <5; ++i)
+ {
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(proto->Spells[i].SpellId);
+ if(!spellInfo)
+ {
+ sLog.outError("Item (Entry: %u) in have wrong spell id %u, ignoring ",proto->ItemId, proto->Spells[i].SpellId);
+ continue;
+ }
- uint8 trade_goods = proto->Class == ITEM_CLASS_TRADE_GOODS && proto->SubClass != ITEM_SUBCLASS_EXPLOSIVES;
- if (consumable || trade_goods ||
- proto->Class == ITEM_CLASS_KEY || proto->Class == ITEM_CLASS_JUNK)
- {
- pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT,pItem,NULL);
- return;
+ if (IsNonCombatSpell(spellInfo->Id))
+ {
+ pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT,pItem,NULL);
+ return;
+ }
}
}