From 68ff8d3faecb4c6304a47ac10b7bfa415b206f13 Mon Sep 17 00:00:00 2001 From: Jens Ayton Date: Sun, 3 Feb 2008 11:52:42 +0000 Subject: [PATCH] Fix for scan class searches. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1342 127b21dd-08f5-0310-b4b7-95ae10353056 --- src/Core/Entities/ShipEntityAI.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Core/Entities/ShipEntityAI.m b/src/Core/Entities/ShipEntityAI.m index ac04e4c9..ffb62bcb 100644 --- a/src/Core/Entities/ShipEntityAI.m +++ b/src/Core/Entities/ShipEntityAI.m @@ -3,7 +3,7 @@ ShipEntityAI.m Oolite -Copyright (C) 2004-2007 Giles C Williams and contributors +Copyright (C) 2004-2008 Giles C Williams and contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -35,6 +35,7 @@ MA 02110-1301, USA. #import "OOStringParsing.h" #import "OOEntityFilterPredicate.h" +#import "OOConstToString.h" #define kOOLogUnconvertedNSLog @"unclassified.ShipEntityAI" @@ -1538,7 +1539,8 @@ WormholeEntity* whole; - (void) scanForNearestShipWithScanClass:(NSString *)scanScanClass { - [self scanForNearestShipWithPredicate:HasScanClassPredicate parameter:scanScanClass]; + NSNumber *parameter = [NSNumber numberWithInt:StringToScanClass(scanScanClass)]; + [self scanForNearestShipWithPredicate:HasScanClassPredicate parameter:parameter]; } @@ -1570,7 +1572,8 @@ WormholeEntity* whole; - (void) scanForNearestShipWithoutScanClass:(NSString *)scanScanClass { - [self scanForNearestShipWithNegatedPredicate:HasScanClassPredicate parameter:scanScanClass]; + NSNumber *parameter = [NSNumber numberWithInt:StringToScanClass(scanScanClass)]; + [self scanForNearestShipWithNegatedPredicate:HasScanClassPredicate parameter:parameter]; }