JS Ship defenseTargets and escorts are now empty arrays rather than null when empty (simpler for clients and conforms with documentation).

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5152 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2012-07-30 23:17:07 +00:00
parent a9c0e85649
commit 64448a6d25

View File

@ -466,11 +466,11 @@ static JSBool ShipGetProperty(JSContext *context, JSObject *this, jsid propID, j
case kShip_defenseTargets:
result = [entity allDefenseTargets];
if (result == nil) result = [NSArray array];
break;
case kShip_escorts:
result = [[entity escortGroup] memberArrayExcludingLeader];
if ([result count] == 0) result = nil;
break;
case kShip_group: