Attempt to fix native exception when a commander dictionary was requested while not docked. Refers to issue #203.
This commit is contained in:
parent
675731ab18
commit
cc6a88d93a
@ -852,7 +852,6 @@ NSComparisonResult marketSorterByMassUnit(id a, id b, void *market);
|
||||
|
||||
- (NSDictionary *) commanderDataDictionary
|
||||
{
|
||||
NSAssert([self isDocked], @"Cannot create commander data dictionary unless docked.");
|
||||
int i;
|
||||
|
||||
NSMutableDictionary *result = [NSMutableDictionary dictionary];
|
||||
@ -1069,9 +1068,16 @@ NSComparisonResult marketSorterByMassUnit(id a, id b, void *market);
|
||||
|
||||
// docked station
|
||||
StationEntity *dockedStation = [self dockedStation];
|
||||
[result setObject:[dockedStation primaryRole] forKey:@"docked_station_role"];
|
||||
HPVector dpos = [dockedStation position];
|
||||
[result setObject:ArrayFromHPVector(dpos) forKey:@"docked_station_position"];
|
||||
[result setObject:dockedStation != nil ? [dockedStation primaryRole]:@"" forKey:@"docked_station_role"];
|
||||
if (dockedStation)
|
||||
{
|
||||
HPVector dpos = [dockedStation position];
|
||||
[result setObject:ArrayFromHPVector(dpos) forKey:@"docked_station_position"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[result setObject:[NSArray array] forKey:@"docked_station_position"];
|
||||
}
|
||||
[result setObject:[UNIVERSE getStationMarkets] forKey:@"station_markets"];
|
||||
|
||||
// scenario information
|
||||
|
Loading…
x
Reference in New Issue
Block a user