Fix equip/unequip with calculations causing a potential watchdog
This commit is contained in:
parent
d5dd79ae1c
commit
ec2c99d175
@ -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))
|
||||
{
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user