mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-19 07:32:25 +00:00
Merge pull request #1112 from noudess/untargettable
Add check so that the 'u' key does not open a trade window with an untargettable mob.
This commit is contained in:
commit
5d4a78fb3f
@ -14246,12 +14246,19 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app)
|
||||
// Client requesting a trade session from an npc/client
|
||||
// Trade session not started until OP_TradeRequestAck is sent
|
||||
|
||||
CommonBreakInvisible();
|
||||
|
||||
// Pass trade request on to recipient
|
||||
TradeRequest_Struct* msg = (TradeRequest_Struct*)app->pBuffer;
|
||||
Mob* tradee = entity_list.GetMob(msg->to_mob_id);
|
||||
|
||||
// If the tradee is an untargettable mob - ignore
|
||||
// Helps in cases where servers use invisible_man, body type 11 for quests
|
||||
// and the client opens a trade by mistake.
|
||||
if (tradee && (tradee->GetBodyType() == 11)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CommonBreakInvisible();
|
||||
|
||||
// Pass trade request on to recipient
|
||||
if (tradee && tradee->IsClient()) {
|
||||
tradee->CastToClient()->QueuePacket(app);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user