Skip to content

Commit 01132b1

Browse files
committed
Core/Misc: Reduce code differences between branches
1 parent 00875fe commit 01132b1

29 files changed

+570
-554
lines changed

src/server/game/Conditions/ConditionMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND
122122
};
123123

124124
// Checks if object meets the condition
125-
// Can have CONDITION_SOURCE_TYPE_NONE && !mReferenceId if called from a special event (ie: eventAI)
125+
// Can have CONDITION_SOURCE_TYPE_NONE && !mReferenceId if called from a special event (ie: SmartAI)
126126
bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
127127
{
128128
ASSERT(ConditionTarget < MAX_CONDITION_TARGETS);

src/server/game/DataStores/DBCStores.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,8 @@ void LoadDBCStores(const std::string& dataPath)
616616
}
617617

618618
// valid taxi network node
619-
uint8 field = (uint8)((node->ID - 1) / 32);
620-
uint32 submask = 1 << ((node->ID - 1) % 32);
619+
uint32 field = uint32((node->ID - 1) / (sizeof(TaxiMask::value_type) * 8));
620+
TaxiMask::value_type submask = TaxiMask::value_type(1 << ((node->ID - 1) % (sizeof(TaxiMask::value_type) * 8)));
621621
sTaxiNodesMask[field] |= submask;
622622

623623
if (node->MountCreatureID[0] && node->MountCreatureID[0] != 32981)

src/server/game/Entities/Item/Item.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,15 +831,15 @@ InventoryResult Item::CanBeMergedPartlyWith(ItemTemplate const* proto) const
831831
{
832832
// not allow merge looting currently items
833833
if (m_lootGenerated)
834-
return EQUIP_ERR_ALREADY_LOOTED;
834+
return EQUIP_ERR_LOOT_GONE;
835835

836836
// check item type
837837
if (GetEntry() != proto->ItemId)
838-
return EQUIP_ERR_ITEM_CANT_STACK;
838+
return EQUIP_ERR_CANT_STACK;
839839

840840
// check free space (full stacks can't be target of merge
841841
if (GetCount() >= proto->GetMaxStackSize())
842-
return EQUIP_ERR_ITEM_CANT_STACK;
842+
return EQUIP_ERR_CANT_STACK;
843843

844844
return EQUIP_ERR_OK;
845845
}

src/server/game/Entities/Item/ItemDefines.h

Lines changed: 92 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -23,95 +23,98 @@
2323
// EnumUtils: DESCRIBE THIS
2424
enum InventoryResult : uint8
2525
{
26-
EQUIP_ERR_OK = 0,
27-
EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1,
28-
EQUIP_ERR_CANT_EQUIP_SKILL = 2,
29-
EQUIP_ERR_ITEM_DOESNT_GO_TO_SLOT = 3,
30-
EQUIP_ERR_BAG_FULL = 4,
31-
EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG = 5,
32-
EQUIP_ERR_CANT_TRADE_EQUIP_BAGS = 6,
33-
EQUIP_ERR_ONLY_AMMO_CAN_GO_HERE = 7,
34-
EQUIP_ERR_NO_REQUIRED_PROFICIENCY = 8,
35-
EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE = 9,
36-
EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM = 10,
37-
EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM2 = 11,
38-
EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE2 = 12,
39-
EQUIP_ERR_CANT_EQUIP_WITH_TWOHANDED = 13,
40-
EQUIP_ERR_CANT_DUAL_WIELD = 14,
41-
EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG = 15,
42-
EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2 = 16,
43-
EQUIP_ERR_CANT_CARRY_MORE_OF_THIS = 17,
44-
EQUIP_ERR_NO_EQUIPMENT_SLOT_AVAILABLE3 = 18,
45-
EQUIP_ERR_ITEM_CANT_STACK = 19,
46-
EQUIP_ERR_ITEM_CANT_BE_EQUIPPED = 20,
47-
EQUIP_ERR_ITEMS_CANT_BE_SWAPPED = 21,
48-
EQUIP_ERR_SLOT_IS_EMPTY = 22,
49-
EQUIP_ERR_ITEM_NOT_FOUND = 23,
50-
EQUIP_ERR_CANT_DROP_SOULBOUND = 24,
51-
EQUIP_ERR_OUT_OF_RANGE = 25,
52-
EQUIP_ERR_TRIED_TO_SPLIT_MORE_THAN_COUNT = 26,
53-
EQUIP_ERR_COULDNT_SPLIT_ITEMS = 27,
54-
EQUIP_ERR_MISSING_REAGENT = 28,
55-
EQUIP_ERR_NOT_ENOUGH_MONEY = 29,
56-
EQUIP_ERR_NOT_A_BAG = 30,
57-
EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS = 31,
58-
EQUIP_ERR_DONT_OWN_THAT_ITEM = 32,
59-
EQUIP_ERR_CAN_EQUIP_ONLY1_QUIVER = 33,
60-
EQUIP_ERR_MUST_PURCHASE_THAT_BAG_SLOT = 34,
61-
EQUIP_ERR_TOO_FAR_AWAY_FROM_BANK = 35,
62-
EQUIP_ERR_ITEM_LOCKED = 36,
63-
EQUIP_ERR_YOU_ARE_STUNNED = 37,
64-
EQUIP_ERR_YOU_ARE_DEAD = 38,
65-
EQUIP_ERR_CANT_DO_RIGHT_NOW = 39,
66-
EQUIP_ERR_INT_BAG_ERROR = 40,
67-
EQUIP_ERR_CAN_EQUIP_ONLY1_BOLT = 41,
68-
EQUIP_ERR_CAN_EQUIP_ONLY1_AMMOPOUCH = 42,
69-
EQUIP_ERR_STACKABLE_CANT_BE_WRAPPED = 43,
70-
EQUIP_ERR_EQUIPPED_CANT_BE_WRAPPED = 44,
71-
EQUIP_ERR_WRAPPED_CANT_BE_WRAPPED = 45,
72-
EQUIP_ERR_BOUND_CANT_BE_WRAPPED = 46,
73-
EQUIP_ERR_UNIQUE_CANT_BE_WRAPPED = 47,
74-
EQUIP_ERR_BAGS_CANT_BE_WRAPPED = 48,
75-
EQUIP_ERR_ALREADY_LOOTED = 49,
76-
EQUIP_ERR_INVENTORY_FULL = 50,
77-
EQUIP_ERR_BANK_FULL = 51,
78-
EQUIP_ERR_ITEM_IS_CURRENTLY_SOLD_OUT = 52,
79-
EQUIP_ERR_BAG_FULL3 = 53,
80-
EQUIP_ERR_ITEM_NOT_FOUND2 = 54,
81-
EQUIP_ERR_ITEM_CANT_STACK2 = 55,
82-
EQUIP_ERR_BAG_FULL4 = 56,
83-
EQUIP_ERR_ITEM_SOLD_OUT = 57,
84-
EQUIP_ERR_OBJECT_IS_BUSY = 58,
85-
EQUIP_ERR_NONE = 59,
86-
EQUIP_ERR_NOT_IN_COMBAT = 60,
87-
EQUIP_ERR_NOT_WHILE_DISARMED = 61,
88-
EQUIP_ERR_BAG_FULL6 = 62,
89-
EQUIP_ERR_CANT_EQUIP_RANK = 63,
90-
EQUIP_ERR_CANT_EQUIP_REPUTATION = 64,
91-
EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65,
92-
EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66,
93-
EQUIP_ERR_ITEM_UNIQUE_EQUIPABLE = 67,
94-
EQUIP_ERR_VENDOR_MISSING_TURNINS = 68,
95-
EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69,
96-
EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70,
97-
EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71,
98-
EQUIP_ERR_MAIL_BOUND_ITEM = 72,
99-
EQUIP_ERR_NO_SPLIT_WHILE_PROSPECTING = 73,
100-
EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75,
101-
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76,
102-
EQUIP_ERR_TOO_MUCH_GOLD = 77,
103-
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78,
104-
EQUIP_ERR_CANNOT_TRADE_THAT = 79,
105-
EQUIP_ERR_PERSONAL_ARENA_RATING_TOO_LOW = 80,
106-
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81,
107-
EQUIP_ERR_ARTEFACTS_ONLY_FOR_OWN_CHARACTERS = 82,
108-
// no output = 83,
109-
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED = 84,
110-
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED = 85,
111-
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86,
112-
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87,
113-
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88,
114-
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED = 89
26+
EQUIP_ERR_OK = 0,
27+
EQUIP_ERR_CANT_EQUIP_LEVEL_I = 1, // You must reach level %d to use that item.
28+
EQUIP_ERR_CANT_EQUIP_SKILL = 2, // You aren't skilled enough to use that item.
29+
EQUIP_ERR_WRONG_SLOT = 3, // That item does not go in that slot.
30+
EQUIP_ERR_BAG_FULL = 4, // That bag is full.
31+
EQUIP_ERR_BAG_IN_BAG = 5, // Can't put non-empty bags in other bags.
32+
EQUIP_ERR_TRADE_EQUIPPED_BAG = 6, // You can't trade equipped bags.
33+
EQUIP_ERR_AMMO_ONLY = 7, // Only ammo can go there.
34+
EQUIP_ERR_PROFICIENCY_NEEDED = 8, // You do not have the required proficiency for that item.
35+
EQUIP_ERR_NO_SLOT_AVAILABLE = 9, // No equipment slot is available for that item.
36+
EQUIP_ERR_CANT_EQUIP_EVER = 10, // You can never use that item.
37+
EQUIP_ERR_CANT_EQUIP_EVER_2 = 11, // You can never use that item.
38+
EQUIP_ERR_NO_SLOT_AVAILABLE_2 = 12, // No equipment slot is available for that item.
39+
EQUIP_ERR_2HANDED_EQUIPPED = 13, // Cannot equip that with a two-handed weapon.
40+
EQUIP_ERR_2HSKILLNOTFOUND = 14, // You cannot dual-wield
41+
EQUIP_ERR_WRONG_BAG_TYPE = 15, // That item doesn't go in that container.
42+
EQUIP_ERR_WRONG_BAG_TYPE_2 = 16, // That item doesn't go in that container.
43+
EQUIP_ERR_ITEM_MAX_COUNT = 17, // You can't carry any more of those items.
44+
EQUIP_ERR_NO_SLOT_AVAILABLE_3 = 18, // No equipment slot is available for that item.
45+
EQUIP_ERR_CANT_STACK = 19, // This item cannot stack.
46+
EQUIP_ERR_NOT_EQUIPPABLE = 20, // This item cannot be equipped.
47+
EQUIP_ERR_CANT_SWAP = 21, // These items can't be swapped.
48+
EQUIP_ERR_SLOT_EMPTY = 22, // That slot is empty.
49+
EQUIP_ERR_ITEM_NOT_FOUND = 23, // The item was not found.
50+
EQUIP_ERR_DROP_BOUND_ITEM = 24, // You can't drop a soulbound item.
51+
EQUIP_ERR_OUT_OF_RANGE = 25, // Out of range.
52+
EQUIP_ERR_TOO_FEW_TO_SPLIT = 26, // Tried to split more than number in stack.
53+
EQUIP_ERR_SPLIT_FAILED = 27, // Couldn't split those items.
54+
EQUIP_ERR_SPELL_FAILED_REAGENTS_GENERIC = 28, // Missing reagent
55+
EQUIP_ERR_NOT_ENOUGH_MONEY = 29, // You don't have enough money.
56+
EQUIP_ERR_NOT_A_BAG = 30, // Not a bag.
57+
EQUIP_ERR_DESTROY_NONEMPTY_BAG = 31, // You can only do that with empty bags.
58+
EQUIP_ERR_NOT_OWNER = 32, // You don't own that item.
59+
EQUIP_ERR_ONLY_ONE_QUIVER = 33, // You can only equip one quiver.
60+
EQUIP_ERR_NO_BANK_SLOT = 34, // You must purchase that bag slot first
61+
EQUIP_ERR_NO_BANK_HERE = 35, // You are too far away from a bank.
62+
EQUIP_ERR_ITEM_LOCKED = 36, // Item is locked.
63+
EQUIP_ERR_GENERIC_STUNNED = 37, // You are stunned
64+
EQUIP_ERR_PLAYER_DEAD = 38, // You can't do that when you're dead.
65+
EQUIP_ERR_CLIENT_LOCKED_OUT = 39, // You can't do that right now.
66+
EQUIP_ERR_INTERNAL_BAG_ERROR = 40, // Internal Bag Error
67+
EQUIP_ERR_ONLY_ONE_BOLT = 41, // You can only equip one quiver.
68+
EQUIP_ERR_ONLY_ONE_AMMO = 42, // You can only equip one ammo pouch.
69+
EQUIP_ERR_CANT_WRAP_STACKABLE = 43, // Stackable items can't be wrapped.
70+
EQUIP_ERR_CANT_WRAP_EQUIPPED = 44, // Equipped items can't be wrapped.
71+
EQUIP_ERR_CANT_WRAP_WRAPPED = 45, // Wrapped items can't be wrapped.
72+
EQUIP_ERR_CANT_WRAP_BOUND = 46, // Bound items can't be wrapped.
73+
EQUIP_ERR_CANT_WRAP_UNIQUE = 47, // Unique items can't be wrapped.
74+
EQUIP_ERR_CANT_WRAP_BAGS = 48, // Bags can't be wrapped.
75+
EQUIP_ERR_LOOT_GONE = 49, // Already looted
76+
EQUIP_ERR_INV_FULL = 50, // Inventory is full.
77+
EQUIP_ERR_BANK_FULL = 51, // Your bank is full
78+
EQUIP_ERR_VENDOR_SOLD_OUT = 52, // That item is currently sold out.
79+
EQUIP_ERR_BAG_FULL_2 = 53, // That bag is full.
80+
EQUIP_ERR_ITEM_NOT_FOUND_2 = 54, // The item was not found.
81+
EQUIP_ERR_CANT_STACK_2 = 55, // This item cannot stack.
82+
EQUIP_ERR_BAG_FULL_3 = 56, // That bag is full.
83+
EQUIP_ERR_VENDOR_SOLD_OUT_2 = 57, // That item is currently sold out.
84+
EQUIP_ERR_OBJECT_IS_BUSY = 58, // That object is busy.
85+
EQUIP_ERR_CANT_BE_DISENCHANTED = 59, // Item cannot be disenchanted
86+
EQUIP_ERR_NOT_IN_COMBAT = 60, // You can't do that while in combat
87+
EQUIP_ERR_NOT_WHILE_DISARMED = 61, // You can't do that while disarmed
88+
EQUIP_ERR_BAG_FULL_4 = 62, // That bag is full.
89+
EQUIP_ERR_CANT_EQUIP_RANK = 63, // You don't have the required rank for that item
90+
EQUIP_ERR_CANT_EQUIP_REPUTATION = 64, // You don't have the required reputation for that item
91+
EQUIP_ERR_TOO_MANY_SPECIAL_BAGS = 65, // You cannot equip another bag of that type
92+
EQUIP_ERR_LOOT_CANT_LOOT_THAT_NOW = 66, // You can't loot that item now.
93+
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE = 67, // You cannot equip more than one of those.
94+
EQUIP_ERR_VENDOR_MISSING_TURNINS = 68, // You do not have the required items for that purchase
95+
EQUIP_ERR_NOT_ENOUGH_HONOR_POINTS = 69, // You don't have enough honor points
96+
EQUIP_ERR_NOT_ENOUGH_ARENA_POINTS = 70, // You don't have enough arena points
97+
EQUIP_ERR_ITEM_MAX_COUNT_SOCKETED = 71, // You have the maximum number of those gems in your inventory or socketed into items.
98+
EQUIP_ERR_MAIL_BOUND_ITEM = 72, // You can't mail soulbound items.
99+
EQUIP_ERR_INTERNAL_BAG_ERROR_2 = 73, // Internal Bag Error
100+
EQUIP_ERR_BAG_FULL_5 = 74, // That bag is full.
101+
EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED = 75, // You have the maximum number of those gems socketed into equipped items.
102+
EQUIP_ERR_ITEM_UNIQUE_EQUIPPABLE_SOCKETED = 76, // You cannot socket more than one of those gems into a single item.
103+
EQUIP_ERR_TOO_MUCH_GOLD = 77, // At gold limit
104+
EQUIP_ERR_NOT_DURING_ARENA_MATCH = 78, // You can't do that while in an arena match
105+
EQUIP_ERR_TRADE_BOUND_ITEM = 79, // You can't trade a soulbound item.
106+
EQUIP_ERR_CANT_EQUIP_RATING = 80, // You don't have the personal, team, or battleground rating required to buy that item
107+
EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM = 81,
108+
EQUIP_ERR_NOT_SAME_ACCOUNT = 82, // Account-bound items can only be given to your own characters.
109+
EQUIP_ERR_NONE = 83,
110+
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS = 84, // You can only carry %d %s
111+
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS = 85, // You can only equip %d |4item:items in the %s category
112+
EQUIP_ERR_SCALING_STAT_ITEM_LEVEL_EXCEEDED = 86, // Your level is too high to use that item
113+
EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW = 87, // You must reach level %d to purchase that item.
114+
EQUIP_ERR_CANT_EQUIP_NEED_TALENT = 88, // You do not have the required talent to equip that.
115+
EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS = 89, // You can only equip %d |4item:items in the %s category
116+
EQUIP_ERR_SHAPESHIFT_FORM_CANNOT_EQUIP = 90, // Cannot equip item in this form
117+
EQUIP_ERR_ITEM_INVENTORY_FULL_SATCHEL = 91, // Your inventory is full. Your satchel has been delivered to your mailbox.
115118
};
116119

117120
// EnumUtils: DESCRIBE THIS

0 commit comments

Comments
 (0)