mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
[Cleanup] Further bot.cpp nullptr checks (#3240)
# Notes - `nullptr` validation
This commit is contained in:
parent
a4e006fbfb
commit
ea9b373180
@ -3145,8 +3145,7 @@ void Bot::SetOwnerTarget(Client* bot_owner) {
|
||||
AddToHateList(attack_target, 1);
|
||||
SetTarget(attack_target);
|
||||
SetAttackingFlag();
|
||||
if (HasPet() && (GetClass() != ENCHANTER || GetPet()->GetPetType() != petAnimation || GetAA(aaAnimationEmpathy) >= 2)) {
|
||||
|
||||
if (GetPet() && (GetClass() != ENCHANTER || GetPet()->GetPetType() != petAnimation || GetAA(aaAnimationEmpathy) >= 2)) {
|
||||
GetPet()->WipeHateList();
|
||||
GetPet()->AddToHateList(attack_target, 1);
|
||||
GetPet()->SetTarget(attack_target);
|
||||
@ -4403,6 +4402,10 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
|
||||
for (auto& trade_iterator : client_trade) {
|
||||
// TODO: code for stackables
|
||||
|
||||
if (!trade_iterator.trade_item_instance) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!database.botdb.SaveItemBySlot(this, trade_iterator.to_bot_slot, trade_iterator.trade_item_instance)) {
|
||||
OwnerMessage(
|
||||
fmt::format(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user