mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Create 'push_invite_response' function
This commit is contained in:
parent
0516526985
commit
027154a5be
@ -284,6 +284,10 @@ impl Controller {
|
||||
self.push_event(ControlEvent::Utterance(utterance));
|
||||
}
|
||||
|
||||
pub fn push_invite_response(&mut self, invite_response: InviteResponse) {
|
||||
self.push_event(ControlEvent::InviteResponse(invite_response));
|
||||
}
|
||||
|
||||
pub fn push_action(&mut self, action: ControlAction) { self.actions.push(action); }
|
||||
|
||||
pub fn push_basic_input(&mut self, input: InputKind) {
|
||||
|
@ -1173,12 +1173,11 @@ impl<'a> AgentData<'a> {
|
||||
agent.target =
|
||||
Some(Target::new(target, false, read_data.time.0, false));
|
||||
}
|
||||
controller.push_event(ControlEvent::InviteResponse(InviteResponse::Accept));
|
||||
controller.push_invite_response(InviteResponse::Accept);
|
||||
agent.behavior.unset(BehaviorState::TRADING_ISSUER);
|
||||
agent.behavior.set(BehaviorState::TRADING);
|
||||
} else {
|
||||
controller
|
||||
.push_event(ControlEvent::InviteResponse(InviteResponse::Decline));
|
||||
controller.push_invite_response(InviteResponse::Decline);
|
||||
self.chat_npc_if_allowed_to_speak(
|
||||
"npc.speech.merchant_busy",
|
||||
agent,
|
||||
@ -1187,7 +1186,7 @@ impl<'a> AgentData<'a> {
|
||||
}
|
||||
} else {
|
||||
// TODO: Provide a hint where to find the closest merchant?
|
||||
controller.push_event(ControlEvent::InviteResponse(InviteResponse::Decline));
|
||||
controller.push_invite_response(InviteResponse::Decline);
|
||||
self.chat_npc_if_allowed_to_speak(
|
||||
"npc.speech.villager_decline_trade",
|
||||
agent,
|
||||
|
Loading…
Reference in New Issue
Block a user