fix tool item stackability on 11/2000

This commit is contained in:
Martin Michelsen
2024-01-01 11:22:03 -08:00
parent 2fda85c750
commit 962ee6874e
16 changed files with 142 additions and 125 deletions
+5 -5
View File
@@ -3671,7 +3671,7 @@ static void on_DF_BB(shared_ptr<Client> c, uint16_t command, uint32_t, string& d
? p->challenge_records.ep2_online_award_state
: p->challenge_records.ep1_online_award_state;
award_state.rank_award_flags |= cmd.rank_bitmask;
p->add_item(cmd.item);
p->add_item(cmd.item, c->version());
l->on_item_id_generated_externally(cmd.item.id);
string desc = s->describe_item(Version::BB_V4, cmd.item, false);
l->log.info("(Challenge mode) Item awarded to player %hhu: %s", c->lobby_client_id, desc.c_str());
@@ -4543,9 +4543,9 @@ static void on_D2_V3_BB(shared_ptr<Client> c, uint16_t, uint32_t, string& data)
auto to_p = to_c->character();
auto from_p = from_c->character();
for (const auto& trade_item : from_c->pending_item_trade->items) {
size_t amount = trade_item.stack_size();
size_t amount = trade_item.stack_size(from_c->version());
auto item = from_p->remove_item(trade_item.id, amount, false);
auto item = from_p->remove_item(trade_item.id, amount, from_c->version());
// This is a special case: when the trade is executed, the client
// deletes the traded items from its own inventory automatically, so we
// should NOT send the 6x29 to that client; we should only send it to
@@ -4557,7 +4557,7 @@ static void on_D2_V3_BB(shared_ptr<Client> c, uint16_t, uint32_t, string& data)
}
}
to_p->add_item(trade_item);
to_p->add_item(trade_item, to_c->version());
send_create_inventory_item_to_lobby(to_c, to_c->lobby_client_id, item);
}
send_command(to_c, 0xD3, 0x00);
@@ -4991,7 +4991,7 @@ static void on_EA_BB(shared_ptr<Client> c, uint16_t command, uint32_t flag, stri
}
}
if (!reward.reward_item.empty()) {
c->current_bank().add_item(reward.reward_item);
c->current_bank().add_item(reward.reward_item, c->version());
}
}
break;