From 1d26aa8eb86326907b7c2c5866dd755c88c986bf Mon Sep 17 00:00:00 2001 From: false_genesis Date: Sat, 23 Feb 2008 23:11:42 +0000 Subject: [PATCH] * fixed endless loop in ProcessChatAI script when no chat message handlers were added and a message came in. thx bLuma! --- bin/scripts/__core_chatAI.def | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/scripts/__core_chatAI.def b/bin/scripts/__core_chatAI.def index 9984c7b..6ce586e 100644 --- a/bin/scripts/__core_chatAI.def +++ b/bin/scripts/__core_chatAI.def @@ -42,6 +42,11 @@ return ${amount} // returns: false if the incoming chatmessage was invalid, else true // TODO: get object name (player or creature) and pass it to the called scripts +// if the list doesnt exist, it will return "", but this counts as false also +if ?{not ?{llen pattern_list}} + return +endif + // filter out chat messages that came from us if ?{equal,${@myguid} ${@2}} return false @@ -72,7 +77,7 @@ set,i 0 set,len ?{llen pattern_list} loop - if ?{equal,${i} ${len}} + if ?{bigger_eq,${i} ${len}} exitloop endif