Eliminated the nested class design of recent EQEmu work; Some more inv2 convergence work

This commit is contained in:
Uleat
2016-04-19 04:02:53 -04:00
parent 53c7abf16e
commit 8edb6e9595
65 changed files with 1196 additions and 1186 deletions
+19 -19
View File
@@ -171,8 +171,8 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
}
//tribute items
for (i = 0; i < EQEmu::Constants::TRIBUTE_SIZE; i++) {
const ItemInst* inst = m_inv[EQEmu::Constants::TRIBUTE_BEGIN + i];
for (i = 0; i < EQEmu::constants::TRIBUTE_SIZE; i++) {
const ItemInst* inst = m_inv[EQEmu::constants::TRIBUTE_BEGIN + i];
if(inst == 0)
continue;
AddItemBonuses(inst, newbon, false, true);
@@ -526,7 +526,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses *newbon, bool isAu
}
if (!isAug) {
for (int i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++)
for (int i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++)
AddItemBonuses(inst->GetAugment(i), newbon, true, false, rec_level, ammo_slot_item);
}
}
@@ -564,7 +564,7 @@ void Client::AdditiveWornBonuses(const ItemInst *inst, StatBonuses* newbon, bool
if (!isAug)
{
int i;
for (i = 0; i < EQEmu::Constants::ITEM_COMMON_SIZE; i++) {
for (i = 0; i < EQEmu::constants::ITEM_COMMON_SIZE; i++) {
AdditiveWornBonuses(inst->GetAugment(i),newbon,true);
}
}
@@ -575,7 +575,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
bool food = false;
bool drink = false;
for (i = EQEmu::Constants::GENERAL_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_BEGIN; i++)
for (i = EQEmu::constants::GENERAL_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_BEGIN; i++)
{
if (food && drink)
break;
@@ -591,7 +591,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
AddItemBonuses(inst, newbon);
}
}
for (i = EQEmu::Constants::GENERAL_BAGS_BEGIN; i <= EQEmu::Constants::GENERAL_BAGS_END; i++)
for (i = EQEmu::constants::GENERAL_BAGS_BEGIN; i <= EQEmu::constants::GENERAL_BAGS_END; i++)
{
if (food && drink)
break;
@@ -3200,7 +3200,7 @@ void NPC::CalcItemBonuses(StatBonuses *newbon)
{
if(newbon){
for (int i = 0; i < EQEmu::Constants::EQUIPMENT_SIZE; i++){
for (int i = 0; i < EQEmu::constants::EQUIPMENT_SIZE; i++){
const Item_Struct *cur = database.GetItem(equipment[i]);
if(cur){
//basic stats
@@ -3278,18 +3278,18 @@ void Client::CalcItemScale() {
bool changed = false;
// MainAmmo excluded in helper function below
if (CalcItemScale(EQEmu::Constants::EQUIPMENT_BEGIN, EQEmu::Constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
if (CalcItemScale(EQEmu::constants::EQUIPMENT_BEGIN, EQEmu::constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
changed = true;
if (CalcItemScale(EQEmu::Constants::GENERAL_BEGIN, EQEmu::Constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
if (CalcItemScale(EQEmu::constants::GENERAL_BEGIN, EQEmu::constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
changed = true;
// I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END
// and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be...
if (CalcItemScale(EQEmu::Constants::GENERAL_BAGS_BEGIN, EQEmu::Constants::GENERAL_BAGS_END)) // (< 341)
if (CalcItemScale(EQEmu::constants::GENERAL_BAGS_BEGIN, EQEmu::constants::GENERAL_BAGS_END)) // (< 341)
changed = true;
if (CalcItemScale(EQEmu::Constants::TRIBUTE_BEGIN, EQEmu::Constants::TRIBUTE_END)) // (< 405)
if (CalcItemScale(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405)
changed = true;
//Power Source Slot
@@ -3320,7 +3320,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items
if (Trader)
if (i >= EQEmu::Constants::GENERAL_BAGS_BEGIN && i <= EQEmu::Constants::GENERAL_BAGS_END) {
if (i >= EQEmu::constants::GENERAL_BAGS_BEGIN && i <= EQEmu::constants::GENERAL_BAGS_END) {
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue;
@@ -3340,7 +3340,7 @@ bool Client::CalcItemScale(uint32 slot_x, uint32 slot_y) {
}
//iterate all augments
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{
ItemInst * a_inst = inst->GetAugment(x);
if(!a_inst)
@@ -3372,18 +3372,18 @@ void Client::DoItemEnterZone() {
bool changed = false;
// MainAmmo excluded in helper function below
if (DoItemEnterZone(EQEmu::Constants::EQUIPMENT_BEGIN, EQEmu::Constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
if (DoItemEnterZone(EQEmu::constants::EQUIPMENT_BEGIN, EQEmu::constants::EQUIPMENT_END)) // original coding excluded MainAmmo (< 21)
changed = true;
if (DoItemEnterZone(EQEmu::Constants::GENERAL_BEGIN, EQEmu::Constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
if (DoItemEnterZone(EQEmu::constants::GENERAL_BEGIN, EQEmu::constants::GENERAL_END)) // original coding excluded MainCursor (< 30)
changed = true;
// I excluded cursor bag slots here because cursor was excluded above..if this is incorrect, change 'slot_y' here to CURSOR_BAG_END
// and 'slot_y' above to CURSOR from GENERAL_END above - or however it is supposed to be...
if (DoItemEnterZone(EQEmu::Constants::GENERAL_BAGS_BEGIN, EQEmu::Constants::GENERAL_BAGS_END)) // (< 341)
if (DoItemEnterZone(EQEmu::constants::GENERAL_BAGS_BEGIN, EQEmu::constants::GENERAL_BAGS_END)) // (< 341)
changed = true;
if (DoItemEnterZone(EQEmu::Constants::TRIBUTE_BEGIN, EQEmu::Constants::TRIBUTE_END)) // (< 405)
if (DoItemEnterZone(EQEmu::constants::TRIBUTE_BEGIN, EQEmu::constants::TRIBUTE_END)) // (< 405)
changed = true;
//Power Source Slot
@@ -3413,7 +3413,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
// TEST CODE: test for bazaar trader crashing with charm items
if (Trader)
if (i >= EQEmu::Constants::GENERAL_BAGS_BEGIN && i <= EQEmu::Constants::GENERAL_BAGS_END) {
if (i >= EQEmu::constants::GENERAL_BAGS_BEGIN && i <= EQEmu::constants::GENERAL_BAGS_END) {
ItemInst* parent_item = m_inv.GetItem(Inventory::CalcSlotId(i));
if (parent_item && parent_item->GetItem()->ID == 17899) // trader satchel
continue;
@@ -3443,7 +3443,7 @@ bool Client::DoItemEnterZone(uint32 slot_x, uint32 slot_y) {
}
//iterate all augments
for (int x = AUG_BEGIN; x < EQEmu::Constants::ITEM_COMMON_SIZE; ++x)
for (int x = AUG_INDEX_BEGIN; x < EQEmu::constants::ITEM_COMMON_SIZE; ++x)
{
ItemInst *a_inst = inst->GetAugment(x);
if(!a_inst)