More numeric to constant conversions..should be most of them... Please report any inventory abnormalities.

This commit is contained in:
Uleat
2014-07-31 07:52:38 -04:00
parent e902373ce7
commit 8b14c21a24
41 changed files with 1402 additions and 1018 deletions
+8 -9
View File
@@ -816,12 +816,11 @@ void Client::OnDisconnect(bool hard_disconnect) {
//#ifdef ITEMCOMBINED
void Client::BulkSendInventoryItems() {
// For future reference: Only the parent item needs to be sent..the ItemInst already contains child ItemInst information
int16 slot_id = 0;
// LINKDEAD TRADE ITEMS
// Move trade slot items back into normal inventory..need them there now for the proceeding validity checks -U
for(slot_id = 3000; slot_id <= 3007; slot_id++) {
for(slot_id = EmuConstants::TRADE_BEGIN; slot_id <= EmuConstants::TRADE_END; slot_id++) {
ItemInst* inst = m_inv.PopItem(slot_id);
if(inst) {
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
@@ -867,7 +866,7 @@ void Client::BulkSendInventoryItems() {
std::map<uint16, std::string>::iterator itr;
//Inventory items
for(slot_id = 0; slot_id <= 30; slot_id++) {
for(slot_id = MAP_BEGIN; slot_id < EmuConstants::MAP_POSSESSIONS_SIZE; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if(inst) {
std::string packet = inst->Serialize(slot_id);
@@ -887,7 +886,7 @@ void Client::BulkSendInventoryItems() {
}
// Bank items
for(slot_id = 2000; slot_id <= 2023; slot_id++) {
for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if(inst) {
std::string packet = inst->Serialize(slot_id);
@@ -897,7 +896,7 @@ void Client::BulkSendInventoryItems() {
}
// Shared Bank items
for(slot_id = 2500; slot_id <= 2501; slot_id++) {
for(slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if(inst) {
std::string packet = inst->Serialize(slot_id);
@@ -928,14 +927,14 @@ void Client::BulkSendInventoryItems()
if(deletenorent){//client was offline for more than 30 minutes, delete no rent items
RemoveNoRent();
}
for (slot_id=0; slot_id<=30; slot_id++) {
for (slot_id=EmuConstants::POSSESSIONS_BEGIN; slot_id<=EmuConstants::POSSESSIONS_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst){
SendItemPacket(slot_id, inst, ItemPacketCharInventory);
}
}
// Bank items
for (slot_id=2000; slot_id<=2015; slot_id++) {
for (slot_id=EmuConstants::BANK_BEGIN; slot_id<=EmuConstants::BANK_END; slot_id++) { // 2015...
const ItemInst* inst = m_inv[slot_id];
if (inst){
SendItemPacket(slot_id, inst, ItemPacketCharInventory);
@@ -943,7 +942,7 @@ void Client::BulkSendInventoryItems()
}
// Shared Bank items
for (slot_id=2500; slot_id<=2501; slot_id++) {
for (slot_id=EmuConstants::SHARED_BANK_BEGIN; slot_id<=EmuConstants::SHARED_BANK_END; slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst){
SendItemPacket(slot_id, inst, ItemPacketCharInventory);
@@ -953,7 +952,7 @@ void Client::BulkSendInventoryItems()
// LINKDEAD TRADE ITEMS
// If player went LD during a trade, they have items in the trade inventory
// slots. These items are now being put into their inventory (then queue up on cursor)
for (int16 trade_slot_id=3000; trade_slot_id<=3007; trade_slot_id++) {
for (int16 trade_slot_id=EmuConstants::TRADE_BEGIN; trade_slot_id<=EmuConstants::TRADE_END; trade_slot_id++) {
const ItemInst* inst = m_inv[slot_id];
if (inst) {
int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size);