Merge branch 'make-merchants-send-trade-on-iteraction' into 'master'

Make merchants send the player a trade request when interacted with

Closes #1368

See merge request veloren/veloren!2914
This commit is contained in:
Joshua Barretto 2021-10-11 16:45:18 +00:00
commit 4bae3a4b62

View File

@ -1081,10 +1081,21 @@ impl<'a> AgentData<'a> {
};
self.chat_general(msg, event_emitter);
} else if agent.behavior.can_trade() {
if !agent.behavior.is(BehaviorState::TRADING) {
controller.events.push(ControlEvent::InitiateInvite(
by,
InviteKind::Trade,
));
self.chat_general(
"npc.speech.merchant_advertisement",
event_emitter,
);
} else {
self.chat_general(
"npc.speech.merchant_busy",
event_emitter,
);
}
} else {
self.chat_general("npc.speech.villager", event_emitter);
}