From 4813c7cde2d16febe834251ea3ee4ff193b90e79 Mon Sep 17 00:00:00 2001 From: Antz Date: Wed, 19 Feb 2020 10:53:43 +0000 Subject: [PATCH] more enum updates --- src/game/Object/Bag.cpp | 8 ++++---- src/game/Object/Bag.h | 2 +- src/game/Object/Creature.cpp | 22 +++++++++++----------- src/game/Object/UpdateFields.h | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/game/Object/Bag.cpp b/src/game/Object/Bag.cpp index 9301a711d..750c3b2c8 100644 --- a/src/game/Object/Bag.cpp +++ b/src/game/Object/Bag.cpp @@ -94,7 +94,7 @@ bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner) // Cleaning 20 slots for (uint8 i = 0; i < MAX_BAG_SIZE; ++i) { - SetGuidValue(CONTAINER_FIELD_SLOT_1 + (i * 2), ObjectGuid()); + SetGuidValue(CONTAINER_FIELD_SLOT + (i * 2), ObjectGuid()); m_bagslot[i] = NULL; } @@ -116,7 +116,7 @@ bool Bag::LoadFromDB(uint32 guidLow, Field* fields, ObjectGuid ownerGuid) // cleanup bag content related item value fields (its will be filled correctly from `character_inventory`) for (int i = 0; i < MAX_BAG_SIZE; ++i) { - SetGuidValue(CONTAINER_FIELD_SLOT_1 + (i * 2), ObjectGuid()); + SetGuidValue(CONTAINER_FIELD_SLOT + (i * 2), ObjectGuid()); delete m_bagslot[i]; m_bagslot[i] = NULL; @@ -158,7 +158,7 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/) } m_bagslot[slot] = NULL; - SetGuidValue(CONTAINER_FIELD_SLOT_1 + (slot * 2), ObjectGuid()); + SetGuidValue(CONTAINER_FIELD_SLOT + (slot * 2), ObjectGuid()); } void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/) @@ -168,7 +168,7 @@ void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/) if (pItem) { m_bagslot[slot] = pItem; - SetGuidValue(CONTAINER_FIELD_SLOT_1 + (slot * 2), pItem->GetObjectGuid()); + SetGuidValue(CONTAINER_FIELD_SLOT + (slot * 2), pItem->GetObjectGuid()); pItem->SetGuidValue(ITEM_FIELD_CONTAINED, GetObjectGuid()); pItem->SetGuidValue(ITEM_FIELD_OWNER, GetOwnerGuid()); pItem->SetContainer(this); diff --git a/src/game/Object/Bag.h b/src/game/Object/Bag.h index efecf55cf..ad0ae3407 100644 --- a/src/game/Object/Bag.h +++ b/src/game/Object/Bag.h @@ -29,7 +29,7 @@ #include "ItemPrototype.h" #include "Item.h" -// Maximum 36 Slots ( (CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2 +// Maximum 36 Slots ( (CONTAINER_END - CONTAINER_FIELD_SLOT)/2 #define MAX_BAG_SIZE 36 // 2.0.12 class Bag : public Item diff --git a/src/game/Object/Creature.cpp b/src/game/Object/Creature.cpp index 1c06f5918..5e1df0d37 100644 --- a/src/game/Object/Creature.cpp +++ b/src/game/Object/Creature.cpp @@ -481,8 +481,8 @@ bool Creature::UpdateEntry(uint32 Entry, Team team, const CreatureData* data /*= SetUInt32Value(UNIT_FIELD_FLAGS_2, unitFlags2); // preserve all current dynamic flags if exist - uint32 dynFlags = GetUInt32Value(UNIT_DYNAMIC_FLAGS); - SetUInt32Value(UNIT_DYNAMIC_FLAGS, dynFlags ? dynFlags : GetCreatureInfo()->DynamicFlags); + //uint32 dynFlags = GetUInt32Value(UNIT_DYNAMIC_FLAGS); + //SetUInt32Value(UNIT_DYNAMIC_FLAGS, dynFlags ? dynFlags : GetCreatureInfo()->dynamicflags); SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(GetCreatureInfo()->Armor)); SetModifierValue(UNIT_MOD_RESISTANCE_HOLY, BASE_VALUE, float(GetCreatureInfo()->ResistanceHoly)); @@ -632,7 +632,7 @@ void Creature::Update(uint32 update_diff, uint32 diff) SelectLevel(cinfo); UpdateAllStats(); // to be sure stats is correct regarding level of the creature - SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); + //SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); if (m_IsDeadByDefault) { SetDeathState(JUST_DIED); @@ -1183,7 +1183,7 @@ void Creature::PrepareBodyLootState() // ... or can have skinning after (GetCreatureInfo()->SkinningLootId && sWorld.getConfig(CONFIG_BOOL_CORPSE_EMPTY_LOOT_SHOW))) { - SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + //SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); return; } } @@ -1193,12 +1193,12 @@ void Creature::PrepareBodyLootState() // if not have normal loot allow skinning if need if (!lootForSkin && GetCreatureInfo()->SkinningLootId) { - RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + //RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); return; } - RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + //RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); } @@ -1271,8 +1271,8 @@ void Creature::SetLootRecipient(Unit* unit) { m_lootRecipientGuid.Clear(); m_lootGroupRecipientId = 0; - RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED); - RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED_BY_PLAYER); + //RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED); + //RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED_BY_PLAYER); return; } @@ -1291,8 +1291,8 @@ void Creature::SetLootRecipient(Unit* unit) m_lootGroupRecipientId = group->GetId(); } - SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED); - SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED_BY_PLAYER); + //SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED); + //SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED_BY_PLAYER); } void Creature::SaveToDB() @@ -2013,7 +2013,7 @@ void Creature::SetDeathState(DeathState s) // Dynamic flags may be adjusted by spells. Clear them // first and let spell from *addon apply where needed. - SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); + //SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); LoadCreatureAddon(true); // Flags after LoadCreatureAddon. Any spell in *addon diff --git a/src/game/Object/UpdateFields.h b/src/game/Object/UpdateFields.h index c3161243d..298b9a734 100644 --- a/src/game/Object/UpdateFields.h +++ b/src/game/Object/UpdateFields.h @@ -527,7 +527,7 @@ enum EPlayerFields enum EContainerFields // Auto generated for version 5, 4, 1, 17538 { - CONTAINER_FIELD_SLOT_1 = ITEM_END + 0x0000, // Size: 72, Type: LONG, Flags: PUBLIC + CONTAINER_FIELD_SLOT = ITEM_END + 0x0000, // Size: 72, Type: LONG, Flags: PUBLIC CONTAINER_FIELD_NUM_SLOTS = ITEM_END + 0x0048, // Size: 1, Type: INT, Flags: PUBLIC CONTAINER_END = ITEM_END + 0x0049 };