Merge pull request #933 from fryguy503/no_trade_combat

Mobs will not trade anymore if they are currently in combat.
This commit is contained in:
Michael Cook (mackal) 2019-11-18 21:59:24 -05:00 committed by GitHub
commit c90326f585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14099,16 +14099,16 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app)
#else #else
else if (tradee && (tradee->IsNPC() || tradee->IsBot())) { else if (tradee && (tradee->IsNPC() || tradee->IsBot())) {
#endif #endif
//npcs always accept if (!tradee->IsEngaged()) {
trade->Start(msg->to_mob_id); trade->Start(msg->to_mob_id);
EQApplicationPacket *outapp = new EQApplicationPacket(OP_TradeRequestAck, sizeof(TradeRequest_Struct));
auto outapp = new EQApplicationPacket(OP_TradeRequestAck, sizeof(TradeRequest_Struct)); TradeRequest_Struct *acc = (TradeRequest_Struct *) outapp->pBuffer;
TradeRequest_Struct* acc = (TradeRequest_Struct*)outapp->pBuffer; acc->from_mob_id = msg->to_mob_id;
acc->from_mob_id = msg->to_mob_id; acc->to_mob_id = msg->from_mob_id;
acc->to_mob_id = msg->from_mob_id; FastQueuePacket(&outapp);
FastQueuePacket(&outapp); safe_delete(outapp);
safe_delete(outapp); }
} }
return; return;
} }