From 37cd07a86e2ed6e86d5ba43a0de3fb8fa9c3a549 Mon Sep 17 00:00:00 2001 From: hexhexd Date: Sun, 8 Oct 2023 16:15:36 -0700 Subject: [PATCH] Improve fast NPC talk --- control/timeouts.txt | 1 - src/Task/TalkNPC.pm | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/control/timeouts.txt b/control/timeouts.txt index 58d2613f6d..0413bd4320 100644 --- a/control/timeouts.txt +++ b/control/timeouts.txt @@ -162,7 +162,6 @@ ai_route_calcRoute 1 ai_route_npcTalk 10 # These timeouts are used in npc conversation (Task::TalkNPC) -ai_npc_talk_wait_to_answer 1.5 ai_npc_talk_wait_after_close_to_cancel 0.5 ai_npc_talk_wait_after_cancel_to_destroy 0.5 diff --git a/src/Task/TalkNPC.pm b/src/Task/TalkNPC.pm index 33d8cec2c5..84537b16f5 100644 --- a/src/Task/TalkNPC.pm +++ b/src/Task/TalkNPC.pm @@ -360,9 +360,6 @@ sub iterate { $self->setError(NPC_NO_RESPONSE, T("The NPC did not respond.")); } elsif ($self->{stage} == TALKING_TO_NPC) { - # $config{npcTimeResponse} seconds have passed since we sent the last conversation step - # or $ai_npc_talk_wait_to_answer seconds have passed since the npc answered us. - if (%talk && $ai_v{'npc_talk'}{'talk'} eq 'initiated') { debug "Spining until a response is needed from us\n", 'ai_npcTalk'; return; @@ -389,7 +386,7 @@ sub iterate { #We must always wait for the last sent step to be answered, if it hasn't then cancel this task. if ($self->{wait_for_answer}) { - if (timeOut($ai_v{'npc_talk'}{'time'}, $ai_npc_talk_wait_to_answer)) { + if (timeOut($ai_v{'npc_talk'}{'time'}, $timeResponse)) { $self->{error_code} = NPC_TIMEOUT_AFTER_ASWER; $self->{error_message} = "We have waited for too long after we sent a response to the npc."; $self->cancelTalk;