From d28c6f9828bb821bf4492f2e7606b1eb377fdcc4 Mon Sep 17 00:00:00 2001 From: Jens Ayton Date: Sat, 12 Sep 2009 23:43:46 +0000 Subject: [PATCH] AI dropMessages: now takes a comma-separated string. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2490 127b21dd-08f5-0310-b4b7-95ae10353056 --- src/Core/Entities/ShipEntityAI.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Core/Entities/ShipEntityAI.m b/src/Core/Entities/ShipEntityAI.m index 3f1e8bf7..f00f66e1 100644 --- a/src/Core/Entities/ShipEntityAI.m +++ b/src/Core/Entities/ShipEntityAI.m @@ -347,11 +347,12 @@ MA 02110-1301, USA. NSArray *messages = nil; NSEnumerator *messageEnum = nil; NSString *message = nil; + NSCharacterSet *whiteSpace = [NSCharacterSet whitespaceCharacterSet]; - messages = ScanTokensFromString(messageString); + messages = [messageString componentsSeparatedByString:@","]; for (messageEnum = [messages objectEnumerator]; (message = [messageEnum nextObject]); ) { - [shipAI dropMessage:message]; + [shipAI dropMessage:[message stringByTrimmingCharactersInSet:whiteSpace]]; } }