mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
merchants no longer run away while trading
(this time without refactoring)
This commit is contained in:
parent
f4fa1e9cd3
commit
ba196c4345
@ -840,12 +840,12 @@ impl<'a> AgentData<'a> {
|
||||
destination_name
|
||||
)
|
||||
};
|
||||
event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc_say(
|
||||
event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc(
|
||||
*self.uid, msg,
|
||||
)));
|
||||
} else if agent.trade_for_site.is_some() {
|
||||
let msg = "Can I interest you in a trade?".to_string();
|
||||
event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc_say(
|
||||
event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc(
|
||||
*self.uid, msg,
|
||||
)));
|
||||
} else {
|
||||
@ -858,10 +858,18 @@ impl<'a> AgentData<'a> {
|
||||
}
|
||||
}
|
||||
},
|
||||
Some(AgentEvent::TradeInvite(_with)) => {
|
||||
Some(AgentEvent::TradeInvite(with)) => {
|
||||
if agent.trade_for_site.is_some() && !agent.trading {
|
||||
// stand still and looking towards the trading player
|
||||
controller.actions.push(ControlAction::Talk);
|
||||
if let Some(target) =
|
||||
read_data.uid_allocator.retrieve_entity_internal(with.id())
|
||||
{
|
||||
agent.target = Some(Target {
|
||||
target,
|
||||
hostile: false,
|
||||
});
|
||||
}
|
||||
controller
|
||||
.events
|
||||
.push(ControlEvent::InviteResponse(InviteResponse::Accept));
|
||||
@ -877,12 +885,12 @@ impl<'a> AgentData<'a> {
|
||||
if agent.trading {
|
||||
match result {
|
||||
TradeResult::Completed => {
|
||||
event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc_say(
|
||||
event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc(
|
||||
*self.uid,
|
||||
"Thank you for trading with me!".to_string(),
|
||||
)))
|
||||
},
|
||||
_ => event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc_say(
|
||||
_ => event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc(
|
||||
*self.uid,
|
||||
"Maybe another time, have a good day!".to_string(),
|
||||
))),
|
||||
@ -1080,7 +1088,7 @@ impl<'a> AgentData<'a> {
|
||||
})
|
||||
);
|
||||
let msg = format!("{}! How dare you cross me again!", e_stats.name.clone());
|
||||
event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc_say(*self.uid, msg)));
|
||||
event_emitter.emit(ServerEvent::Chat(UnresolvedChatMsg::npc(*self.uid, msg)));
|
||||
true
|
||||
} else {
|
||||
false
|
||||
|
Loading…
Reference in New Issue
Block a user