1
0

Fix equip/unequip with calculations causing a potential watchdog

This commit is contained in:
Emagi 2025-05-28 14:33:34 -04:00
parent d5dd79ae1c
commit ec2c99d175
3 changed files with 5 additions and 2 deletions

View File

@ -7221,6 +7221,7 @@ void Commands::Command_Inventory(Client* client, Seperator* sep, EQ2_RemoteComma
}
client->UnequipItem(index, bag_id, to_slot, appearance_equip);
client->GetPlayer()->CalculateBonuses();
}
else if(sep->arg[2][0] && strncasecmp("swap_equip", sep->arg[0], 10) == 0 && sep->IsNumber(1) && sep->IsNumber(2))
{

View File

@ -7066,7 +7066,10 @@ int EQ2Emu_lua_UnequipSlot(lua_State* state) {
}
else{
Client* client = ((Player*)spawn)->GetClient();
client->UnequipItem(item->details.index);
if(client) {
client->UnequipItem(item->details.index);
client->GetPlayer()->CalculateBonuses();
}
}
}
}

View File

@ -8066,7 +8066,6 @@ void Client::UnequipItem(int16 index, sint32 bag_id, int8 to_slot, int8 appearan
}
GetPlayer()->UpdateWeapons();
GetPlayer()->CalculateBonuses();
EQ2Packet* characterSheetPackets = GetPlayer()->GetPlayerInfo()->serialize(GetVersion());
QueuePacket(characterSheetPackets);
}