Delinked current inventory slot enumeration and constants from EQEmu::constants and global definition

This commit is contained in:
Uleat
2016-04-22 07:34:55 -04:00
parent b3475d7b50
commit 1890d006a2
65 changed files with 1835 additions and 1849 deletions
+11 -11
View File
@@ -485,7 +485,7 @@ int32 Client::GetRawItemAC()
{
int32 Total = 0;
// this skips MainAmmo..add an '=' conditional if that slot is required (original behavior)
for (int16 slot_id = EQEmu::constants::EQUIPMENT_BEGIN; slot_id < EQEmu::constants::EQUIPMENT_END; slot_id++) {
for (int16 slot_id = EQEmu::legacy::EQUIPMENT_BEGIN; slot_id < EQEmu::legacy::EQUIPMENT_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst && inst->IsType(ItemClassCommon)) {
Total += inst->GetItem()->AC;
@@ -1067,9 +1067,9 @@ int32 Client::CalcAC()
}
// Shield AC bonus for HeroicSTR
if (itembonuses.HeroicSTR) {
bool equiped = CastToClient()->m_inv.GetItem(SlotSecondary);
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
if (equiped) {
uint8 shield = CastToClient()->m_inv.GetItem(SlotSecondary)->GetItem()->ItemType;
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
if (shield == ItemTypeShield) {
displayed += itembonuses.HeroicSTR / 2;
}
@@ -1096,9 +1096,9 @@ int32 Client::GetACMit()
}
// Shield AC bonus for HeroicSTR
if (itembonuses.HeroicSTR) {
bool equiped = CastToClient()->m_inv.GetItem(SlotSecondary);
bool equiped = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary);
if (equiped) {
uint8 shield = CastToClient()->m_inv.GetItem(SlotSecondary)->GetItem()->ItemType;
uint8 shield = CastToClient()->m_inv.GetItem(EQEmu::legacy::SlotSecondary)->GetItem()->ItemType;
if (shield == ItemTypeShield) {
mitigation += itembonuses.HeroicSTR / 2;
}
@@ -1306,7 +1306,7 @@ uint32 Client::CalcCurrentWeight()
ItemInst* ins;
uint32 Total = 0;
int x;
for (x = EQEmu::constants::EQUIPMENT_BEGIN; x <= SlotCursor; x++) { // include cursor or not?
for (x = EQEmu::legacy::EQUIPMENT_BEGIN; x <= EQEmu::legacy::SlotCursor; x++) { // include cursor or not?
TempItem = 0;
ins = GetInv().GetItem(x);
if (ins) {
@@ -1316,7 +1316,7 @@ uint32 Client::CalcCurrentWeight()
Total += TempItem->Weight;
}
}
for (x = EQEmu::constants::GENERAL_BAGS_BEGIN; x <= EQEmu::constants::GENERAL_BAGS_END; x++) { // include cursor bags or not?
for (x = EQEmu::legacy::GENERAL_BAGS_BEGIN; x <= EQEmu::legacy::GENERAL_BAGS_END; x++) { // include cursor bags or not?
int TmpWeight = 0;
TempItem = 0;
ins = GetInv().GetItem(x);
@@ -1329,9 +1329,9 @@ uint32 Client::CalcCurrentWeight()
if (TmpWeight > 0) {
// this code indicates that weight redux bags can only be in the first general inventory slot to be effective...
// is this correct? or can we scan for the highest weight redux and use that? (need client verifications)
int bagslot = SlotGeneral1;
int bagslot = EQEmu::legacy::SlotGeneral1;
int reduction = 0;
for (int m = EQEmu::constants::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::constants::GENERAL_BAGS_END; m += 10) { // include cursor bags or not?
for (int m = EQEmu::legacy::GENERAL_BAGS_BEGIN + 10; m <= EQEmu::legacy::GENERAL_BAGS_END; m += 10) { // include cursor bags or not?
if (x >= m) {
bagslot += 1;
}
@@ -2205,12 +2205,12 @@ int Client::GetRawACNoShield(int &shield_ac) const
{
int ac = itembonuses.AC + spellbonuses.AC + aabonuses.AC;
shield_ac = 0;
const ItemInst *inst = m_inv.GetItem(SlotSecondary);
const ItemInst *inst = m_inv.GetItem(EQEmu::legacy::SlotSecondary);
if (inst) {
if (inst->GetItem()->ItemType == ItemTypeShield) {
ac -= inst->GetItem()->AC;
shield_ac = inst->GetItem()->AC;
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
for (uint8 i = AUG_INDEX_BEGIN; i < EQEmu::legacy::ITEM_COMMON_SIZE; i++) {
if (inst->GetAugment(i)) {
ac -= inst->GetAugment(i)->GetItem()->AC;
shield_ac += inst->GetAugment(i)->GetItem()->AC;