Skip to content

Commit

Permalink
Merge pull request #5725 from TiberonKalkaz/storage_integer_overflow
Browse files Browse the repository at this point in the history
Increases inventory storage ItemNum2 to uint16 to fix uint8 overflow
  • Loading branch information
claywar authored May 13, 2024
2 parents 049eeef + 653433d commit bbdffc8
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/map/packets/inventory_size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ CInventorySizePacket::CInventorySizePacket(CCharEntity* PChar)
ref<uint8>(0x15) = 1 + PChar->getStorage(LOC_RECYCLEBIN)->GetSize();

// These set the usable amount of the container. 0x00 disables the container.
ref<uint8>(0x24) = 1 + PChar->getStorage(LOC_INVENTORY)->GetBuff();
ref<uint8>(0x26) = 1 + PChar->getStorage(LOC_MOGSAFE)->GetBuff();
ref<uint8>(0x28) = 1 + PChar->getStorage(LOC_STORAGE)->GetBuff();
ref<uint8>(0x2A) = 1 + PChar->getStorage(LOC_TEMPITEMS)->GetBuff();
ref<uint8>(0x2C) = charutils::hasMogLockerAccess(PChar) ? 1 + PChar->getStorage(LOC_MOGLOCKER)->GetBuff() : 0x00;
ref<uint8>(0x2E) = 1 + PChar->getStorage(LOC_MOGSATCHEL)->GetBuff();
ref<uint8>(0x30) = 1 + PChar->getStorage(LOC_MOGSACK)->GetBuff();
ref<uint8>(0x32) = 1 + PChar->getStorage(LOC_MOGCASE)->GetBuff();
ref<uint8>(0x34) = 1 + PChar->getStorage(LOC_WARDROBE)->GetBuff();
ref<uint8>(0x36) = 1 + PChar->getStorage(LOC_MOGSAFE2)->GetBuff();
ref<uint8>(0x38) = 1 + PChar->getStorage(LOC_WARDROBE2)->GetBuff();
ref<uint8>(0x3A) = 1 + PChar->getStorage(LOC_WARDROBE3)->GetBuff();
ref<uint8>(0x3C) = 1 + PChar->getStorage(LOC_WARDROBE4)->GetBuff();
ref<uint8>(0x3E) = 1 + PChar->getStorage(LOC_WARDROBE5)->GetBuff();
ref<uint8>(0x40) = 1 + PChar->getStorage(LOC_WARDROBE6)->GetBuff();
ref<uint8>(0x42) = 1 + PChar->getStorage(LOC_WARDROBE7)->GetBuff();
ref<uint8>(0x44) = 1 + PChar->getStorage(LOC_WARDROBE8)->GetBuff();
ref<uint8>(0x46) = 1 + PChar->getStorage(LOC_RECYCLEBIN)->GetBuff();
ref<uint16>(0x24) = 1 + PChar->getStorage(LOC_INVENTORY)->GetBuff();
ref<uint16>(0x26) = 1 + PChar->getStorage(LOC_MOGSAFE)->GetBuff();
ref<uint16>(0x28) = 1 + PChar->getStorage(LOC_STORAGE)->GetBuff();
ref<uint16>(0x2A) = 1 + PChar->getStorage(LOC_TEMPITEMS)->GetBuff();
ref<uint16>(0x2C) = charutils::hasMogLockerAccess(PChar) ? 1 + PChar->getStorage(LOC_MOGLOCKER)->GetBuff() : 0x00;
ref<uint16>(0x2E) = 1 + PChar->getStorage(LOC_MOGSATCHEL)->GetBuff();
ref<uint16>(0x30) = 1 + PChar->getStorage(LOC_MOGSACK)->GetBuff();
ref<uint16>(0x32) = 1 + PChar->getStorage(LOC_MOGCASE)->GetBuff();
ref<uint16>(0x34) = 1 + PChar->getStorage(LOC_WARDROBE)->GetBuff();
ref<uint16>(0x36) = 1 + PChar->getStorage(LOC_MOGSAFE2)->GetBuff();
ref<uint16>(0x38) = 1 + PChar->getStorage(LOC_WARDROBE2)->GetBuff();
ref<uint16>(0x3A) = 1 + PChar->getStorage(LOC_WARDROBE3)->GetBuff();
ref<uint16>(0x3C) = 1 + PChar->getStorage(LOC_WARDROBE4)->GetBuff();
ref<uint16>(0x3E) = 1 + PChar->getStorage(LOC_WARDROBE5)->GetBuff();
ref<uint16>(0x40) = 1 + PChar->getStorage(LOC_WARDROBE6)->GetBuff();
ref<uint16>(0x42) = 1 + PChar->getStorage(LOC_WARDROBE7)->GetBuff();
ref<uint16>(0x44) = 1 + PChar->getStorage(LOC_WARDROBE8)->GetBuff();
ref<uint16>(0x46) = 1 + PChar->getStorage(LOC_RECYCLEBIN)->GetBuff();
}

0 comments on commit bbdffc8

Please sign in to comment.