enforce stack limits when loading BB character data
Docker / Build (push) Has been cancelled

This commit is contained in:
Martin Michelsen
2025-08-06 21:23:30 -07:00
parent 5c84581978
commit a9dcd4b87e
6 changed files with 36 additions and 12 deletions
+7
View File
@@ -859,6 +859,13 @@ void Client::load_all_files() {
if (this->character_data) {
// Clear legacy play_time field
this->character_data->disp.name.clear_after_bytes(0x18);
// Enforce item stack limits, in case they've changed
auto s = this->require_server_state();
auto stack_limits = s->item_stack_limits(this->version());
this->character_data->inventory.enforce_stack_limits(stack_limits);
this->character_data->bank.enforce_stack_limits(stack_limits);
this->login->account->auto_reply_message = this->character_data->auto_reply.decode();
this->login->account->save();
this->last_play_time_update = phosg::now();