mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Create 'push_initiate_invite' function
This commit is contained in:
parent
027154a5be
commit
b0d6a68e8c
@ -288,6 +288,10 @@ impl Controller {
|
||||
self.push_event(ControlEvent::InviteResponse(invite_response));
|
||||
}
|
||||
|
||||
pub fn push_initiate_invite(&mut self, uid: Uid, invite: InviteKind) {
|
||||
self.push_event(ControlEvent::InitiateInvite(uid, invite));
|
||||
}
|
||||
|
||||
pub fn push_action(&mut self, action: ControlAction) { self.actions.push(action); }
|
||||
|
||||
pub fn push_basic_input(&mut self, input: InputKind) {
|
||||
|
@ -1015,10 +1015,7 @@ impl<'a> AgentData<'a> {
|
||||
self.chat_npc(msg, event_emitter);
|
||||
} else if agent.behavior.can_trade() {
|
||||
if !agent.behavior.is(BehaviorState::TRADING) {
|
||||
controller.push_event(ControlEvent::InitiateInvite(
|
||||
by,
|
||||
InviteKind::Trade,
|
||||
));
|
||||
controller.push_initiate_invite(by, InviteKind::Trade);
|
||||
self.chat_npc(
|
||||
"npc.speech.merchant_advertisement",
|
||||
event_emitter,
|
||||
@ -1036,10 +1033,7 @@ impl<'a> AgentData<'a> {
|
||||
Subject::Trade => {
|
||||
if agent.behavior.can_trade() {
|
||||
if !agent.behavior.is(BehaviorState::TRADING) {
|
||||
controller.push_event(ControlEvent::InitiateInvite(
|
||||
by,
|
||||
InviteKind::Trade,
|
||||
));
|
||||
controller.push_initiate_invite(by, InviteKind::Trade);
|
||||
self.chat_npc(
|
||||
"npc.speech.merchant_advertisement",
|
||||
event_emitter,
|
||||
|
Loading…
Reference in New Issue
Block a user