mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7021] Not check allowed class/race for items with inventory type INVTYPE_NON_EQUIP that can't be used from inventory.
This commit is contained in:
parent
977cb3f8d4
commit
dbc228370c
2 changed files with 23 additions and 7 deletions
|
|
@ -1672,14 +1672,30 @@ void ObjectMgr::LoadItemPrototypes()
|
|||
const_cast<ItemPrototype*>(proto)->RequiredSkill = 0;
|
||||
}
|
||||
|
||||
if(!(proto->AllowableClass & CLASSMASK_ALL_PLAYABLE))
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not have in `AllowableClass` any playable classes (%u) and can't be equipped.",i,proto->AllowableClass);
|
||||
}
|
||||
|
||||
if(!(proto->AllowableRace & RACEMASK_ALL_PLAYABLE))
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) not have in `AllowableRace` any playable races (%u) and can't be equipped.",i,proto->AllowableRace);
|
||||
// can be used in equip slot, as page read use in inventory, or spell casting at use
|
||||
bool req = proto->InventoryType!=INVTYPE_NON_EQUIP || proto->PageText;
|
||||
if(!req)
|
||||
{
|
||||
for (int j = 0; j < 5; ++j)
|
||||
{
|
||||
if(proto->Spells[j].SpellId)
|
||||
{
|
||||
req = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(req)
|
||||
{
|
||||
if(!(proto->AllowableClass & CLASSMASK_ALL_PLAYABLE))
|
||||
sLog.outErrorDb("Item (Entry: %u) not have in `AllowableClass` any playable classes (%u) and can't be equipped or use.",i,proto->AllowableClass);
|
||||
|
||||
if(!(proto->AllowableRace & RACEMASK_ALL_PLAYABLE))
|
||||
sLog.outErrorDb("Item (Entry: %u) not have in `AllowableRace` any playable races (%u) and can't be equipped or use.",i,proto->AllowableRace);
|
||||
}
|
||||
}
|
||||
|
||||
if(proto->RequiredSpell && !sSpellStore.LookupEntry(proto->RequiredSpell))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue