diff --git a/notes/psobb/ItemRT_Ep4.gsl b/notes/psobb/ItemRT_Ep4.gsl index 4224bcdc..e0a30d8b 100755 Binary files a/notes/psobb/ItemRT_Ep4.gsl and b/notes/psobb/ItemRT_Ep4.gsl differ diff --git a/src/Player.cc b/src/Player.cc index 01d7e3b0..2efd53fd 100644 --- a/src/Player.cc +++ b/src/Player.cc @@ -101,6 +101,7 @@ void ClientGameData::create_challenge_overlay(size_t template_index, shared_ptr< for (size_t z = 0; z < overlay->inventory.items.size(); z++) { auto& i = overlay->inventory.items[z]; i.present = 0; + i.unknown_a1 = 0; i.extension_data1 = 0; i.extension_data2 = 0; i.flags = 0; @@ -124,6 +125,7 @@ void ClientGameData::create_challenge_overlay(size_t template_index, shared_ptr< for (size_t z = 0; z < tpl.items.size(); z++) { auto& inv_item = overlay->inventory.items[z]; inv_item.present = tpl.items[z].present; + inv_item.unknown_a1 = tpl.items[z].unknown_a1; inv_item.flags = tpl.items[z].flags; inv_item.data = tpl.items[z].data; } @@ -350,6 +352,7 @@ void SavedPlayerDataBB::add_item(const ItemData& item) { } auto& inv_item = this->inventory.items[this->inventory.num_items]; inv_item.present = 1; + inv_item.unknown_a1 = 0; inv_item.flags = 0; inv_item.data = item; this->inventory.num_items++; @@ -395,6 +398,7 @@ ItemData SavedPlayerDataBB::remove_item(uint32_t item_id, uint32_t amount, bool } auto& last_item = this->inventory.items[this->inventory.num_items]; last_item.present = 0; + last_item.unknown_a1 = 0; last_item.flags = 0; last_item.data.clear(); return ret; diff --git a/src/PlayerSubordinates.cc b/src/PlayerSubordinates.cc index 9eb7d53d..7eaf9b14 100644 --- a/src/PlayerSubordinates.cc +++ b/src/PlayerSubordinates.cc @@ -562,6 +562,7 @@ size_t PlayerInventory::remove_all_items_of_type(uint8_t data1_0, int16_t data1_ if (!should_delete) { if (read_offset != write_offset) { this->items[write_offset].present = this->items[read_offset].present; + this->items[write_offset].unknown_a1 = this->items[read_offset].unknown_a1; this->items[write_offset].flags = this->items[read_offset].flags; this->items[write_offset].data = this->items[read_offset].data; } @@ -809,6 +810,7 @@ const ChallengeTemplateDefinition& get_challenge_template_definition(uint32_t cl static auto make_template_item = +[](bool equipped, uint64_t first_data, uint64_t second_data = 0) -> PlayerInventoryItem { PlayerInventoryItem ret = { .present = 1, + .unknown_a1 = 0, .extension_data1 = 0, .extension_data2 = 0, .flags = (equipped ? 8 : 0), diff --git a/src/PlayerSubordinates.hh b/src/PlayerSubordinates.hh index 22002161..262df4bc 100644 --- a/src/PlayerSubordinates.hh +++ b/src/PlayerSubordinates.hh @@ -43,7 +43,8 @@ extern FileContentsCache player_files_cache; // Unknown. These are not an array, but do appear to be related. struct PlayerInventoryItem { - /* 00 */ le_uint16_t present = 0; + /* 00 */ uint8_t present = 0; + /* 01 */ uint8_t unknown_a1 = 0; // See note above about these fields /* 02 */ uint8_t extension_data1 = 0; /* 03 */ uint8_t extension_data2 = 0;