Core/Vendors: Support for vendors with empty inventory list
Port From (https://github.com/TrinityCore/TrinityCore/commit/bedc0503578b220b19d23559f670f65d26c8bc87)
This commit is contained in:
@@ -149,7 +149,7 @@ namespace Framework.Constants
|
||||
}
|
||||
|
||||
public enum NPCFlags2
|
||||
{
|
||||
{
|
||||
None = 0x00,
|
||||
ItemUpgradeMaster = 0x01,
|
||||
GarrisonArchitect = 0x02,
|
||||
@@ -394,4 +394,10 @@ namespace Framework.Constants
|
||||
|
||||
Max
|
||||
}
|
||||
|
||||
public enum VendorInventoryReason
|
||||
{
|
||||
None = 0,
|
||||
Empty = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2294,14 +2294,6 @@ namespace Game.Entities
|
||||
if (!IsDead())
|
||||
canTalk = false;
|
||||
break;
|
||||
case GossipOption.Vendor:
|
||||
VendorItemData vendorItems = creature.GetVendorItems();
|
||||
if (vendorItems == null || vendorItems.Empty())
|
||||
{
|
||||
Log.outError(LogFilter.Sql, "Creature (GUID: {0}, Entry: {1}) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.", creature.GetGUID().ToString(), creature.GetEntry());
|
||||
canTalk = false;
|
||||
}
|
||||
break;
|
||||
case GossipOption.Learndualspec:
|
||||
canTalk = false;
|
||||
break;
|
||||
@@ -2324,8 +2316,9 @@ namespace Game.Entities
|
||||
case GossipOption.Questgiver:
|
||||
canTalk = false;
|
||||
break;
|
||||
case GossipOption.Trainer:
|
||||
case GossipOption.Gossip:
|
||||
case GossipOption.Vendor:
|
||||
case GossipOption.Trainer:
|
||||
case GossipOption.Spiritguide:
|
||||
case GossipOption.Innkeeper:
|
||||
case GossipOption.Banker:
|
||||
|
||||
@@ -564,6 +564,8 @@ namespace Game
|
||||
break;
|
||||
}
|
||||
|
||||
packet.Reason = (byte)(count != 0 ? VendorInventoryReason.None : VendorInventoryReason.Empty);
|
||||
|
||||
SendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user