Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
ShipEntity(Private) Category Reference

Instance Methods

(void) - subEntityDied:
 
(void) - subEntityReallyDied:
 
(void) - drawDebugStuff
 
(void) - rescaleBy:
 
(void) - rescaleBy:writeToCache:
 
(BOOL) - setUpOneSubentity:
 
(BOOL) - setUpOneFlasher:
 
(Entity< OOStellarBody > *) - lastAegisLock
 
(void) - addSubEntity:
 
(void) - refreshEscortPositions
 
(HPVector) - coordinatesForEscortPosition:
 
(void) - setUpMixedEscorts
 
(void) - setUpOneEscort:inGroup:withRole:atPosition:andCount:
 
(void) - addSubentityToCollisionRadius:
 
(ShipEntity *) - launchPodWithCrew:
 
(OOEquipmentType *) - generateMissileEquipmentTypeFrom:
 
(void) - setShipHitByLaser:
 
(void) - noteFrustration:
 
(BOOL) - cloakPassive
 

Detailed Description

Definition at line 131 of file ShipEntity.m.

Method Documentation

◆ addSubEntity:

- (void) addSubEntity: (Entity< OOSubEntity > *) subent

Extends class ShipEntity.

Definition at line 6496 of file ShipEntity.m.

6707 :(Entity<OOSubEntity> *)sub
6708{
6709 if (sub == nil) return;
6710
6711 if (subEntities == nil) subEntities = [[NSMutableArray alloc] init];
6712 sub->isSubEntity = YES;
6713 // Order matters - need consistent state in setOwner:. -- Ahruman 2008-04-20
6714 [subEntities addObject:sub];
6715 [sub setOwner:self];
6716
6717 [self addSubentityToCollisionRadius:sub];
6718}
return nil

◆ addSubentityToCollisionRadius:

- (void) addSubentityToCollisionRadius: (Entity< OOSubEntity > *) subent

Extends class ShipEntity.

Definition at line 2093 of file ShipEntity.m.

2256 :(Entity<OOSubEntity> *)subent
2257{
2258 if (!subent) return;
2259
2260 double distance = HPmagnitude([subent position]) + [subent findCollisionRadius];
2261 if ([subent isKindOfClass:[ShipEntity class]]) // Solid subentity
2262 {
2263 if (distance > collision_radius)
2264 {
2265 collision_radius = distance;
2266 }
2267
2268 mass += [subent mass];
2269 }
2270 if (distance > _profileRadius)
2271 {
2272 _profileRadius = distance;
2273 }
2274}

◆ cloakPassive

- (BOOL) cloakPassive

Extends class ShipEntity.

Definition at line 266 of file ShipEntity.h.

◆ coordinatesForEscortPosition:

- (HPVector) coordinatesForEscortPosition: (unsigned) idx

Extends class ShipEntity.

Definition at line 9593 of file ShipEntity.m.

13821 :(unsigned)idx
13822{
13823 /*
13824 This function causes problems with Thargoids: their missiles (aka Thargons) are automatically
13825 added to the escorts group, and when a mother ship dies all thargons will attach themselves
13826 as escorts to the surviving battleships. This can lead to huge escort groups.
13827 TODO: better handling of Thargoid groups:
13828 - put thargons (& all other thargon missiles) in their own non-escort group perhaps?
13829 */
13830
13831 // The _escortPositions array is always MAX_ESCORTS long.
13832 // Kludge: return the same last escort position if we have escorts above MAX_ESCORTS...
13833 idx = MIN(idx, (unsigned)(MAX_ESCORTS - 1));
13834
13835 return HPvector_add(self->position, vectorToHPVector(quaternion_rotate_vector([self normalOrientation], _escortPositions[idx])));
13836}
#define MIN(A, B)
Definition OOMaths.h:111
return self
Vector quaternion_rotate_vector(Quaternion q, Vector v)
#define MAX_ESCORTS
Definition ShipEntity.h:74

◆ drawDebugStuff

- (void) drawDebugStuff

Extends class ShipEntity.

Definition at line 2093 of file ShipEntity.m.

6428{
6429 // HPVect: imprecise here - needs camera relative
6430 if (0 && reportAIMessages)
6431 {
6432 OODebugDrawPoint(HPVectorToVector(_destination), [OOColor blueColor]);
6433 OODebugDrawColoredLine(HPVectorToVector([self position]), HPVectorToVector(_destination), [OOColor colorWithWhite:0.15 alpha:1.0]);
6434
6435 Entity *pTarget = [self primaryTarget];
6436 if (pTarget != nil)
6437 {
6438 OODebugDrawPoint(HPVectorToVector([pTarget position]), [OOColor redColor]);
6439 OODebugDrawColoredLine(HPVectorToVector([self position]), HPVectorToVector([pTarget position]), [OOColor colorWithRed:0.2 green:0.0 blue:0.0 alpha:1.0]);
6440 }
6441
6442 Entity *sTarget = [self targetStation];
6443 if (sTarget != pTarget && [sTarget isStation])
6444 {
6445 OODebugDrawPoint(HPVectorToVector([sTarget position]), [OOColor cyanColor]);
6446 }
6447
6448 Entity *fTarget = [self foundTarget];
6449 if (fTarget != nil && fTarget != pTarget && fTarget != sTarget)
6450 {
6451 OODebugDrawPoint(HPVectorToVector([fTarget position]), [OOColor magentaColor]);
6452 }
6453 }
6454}
void OODebugDrawColoredLine(Vector start, Vector end, OOColor *color)
void OODebugDrawPoint(Vector position, OOColor *color)

◆ generateMissileEquipmentTypeFrom:

- (OOEquipmentType *) generateMissileEquipmentTypeFrom: (NSString *) role

Extends class ShipEntity.

Definition at line 2093 of file ShipEntity.m.

3328 :(NSString *)role
3329{
3330 /* The generated missile equipment type provides for backward compatibility with pre-1.74 OXPs missile_roles
3331 and follows this template:
3332
3333 //NPC equipment, incompatible with player ship. Not buyable because of its TL.
3334 (
3335 100, 100000, "Missile",
3336 "EQ_X_MISSILE",
3337 "Unidentified missile type.",
3338 {
3339 is_external_store = true;
3340 }
3341 )
3342 */
3343 NSArray *itemInfo = [NSArray arrayWithObjects:@"100", @"100000", @"Missile", role, @"Unidentified missile type.",
3344 [NSDictionary dictionaryWithObjectsAndKeys: @"true", @"is_external_store", nil], nil];
3345
3348}
void addEquipmentWithInfo:(NSArray *itemInfo)
OOEquipmentType * equipmentTypeWithIdentifier:(NSString *identifier)

◆ lastAegisLock

- (Entity< OOStellarBody > *) lastAegisLock

Extends class ShipEntity.

Definition at line 7619 of file ShipEntity.m.

7886{
7887 Entity<OOStellarBody> *stellar = [_lastAegisLock weakRefUnderlyingObject];
7888 if (stellar == nil)
7889 {
7890 [_lastAegisLock release];
7891 _lastAegisLock = nil;
7892 }
7893
7894 return stellar;
7895}

◆ launchPodWithCrew:

- (ShipEntity *) launchPodWithCrew: (NSArray *) podCrew

Extends class ShipEntity.

Definition at line 2093 of file ShipEntity.m.

2277 :(NSArray *)podCrew
2278{
2279 ShipEntity *pod = nil;
2280
2281 pod = [UNIVERSE newShipWithRole:[shipinfoDictionary oo_stringForKey:@"escape_pod_role"]]; // or nil
2282 if (!pod)
2283 {
2284 // _role not defined? it might have _model defined;
2285 pod = [UNIVERSE newShipWithRole:[shipinfoDictionary oo_stringForKey:@"escape_pod_model" defaultValue:@"escape-capsule"]];
2286 if (!pod)
2287 {
2288 pod = [UNIVERSE newShipWithRole:@"escape-capsule"];
2289 OOLog(@"shipEntity.noEscapePod", @"Ship %@ has no correct escape_pod_role defined. Now using default capsule.", self);
2290 }
2291 }
2292
2293 if (pod)
2294 {
2295 [pod setOwner:self];
2296 [pod setTemperature:[self randomEjectaTemperatureWithMaxFactor:0.9]];
2297 [pod setCommodity:@"slaves" andAmount:1];
2298 [pod setCrew:podCrew];
2299 [pod switchAITo:@"oolite-shuttleAI.js"];
2300 [self dumpItem:pod]; // CLASS_CARGO, STATUS_IN_FLIGHT, AI state GLOBAL
2301 [pod release]; //release
2302 }
2303
2304 return pod;
2305}
#define OOLog(class, format,...)
Definition OOLogging.h:88
void setTemperature:(GLfloat value)
void setCrew:(NSArray *crewArray)
void switchAITo:(NSString *aiString)
void setCommodity:andAmount:(OOCommodityType co_type,[andAmount] OOCargoQuantity co_amount)
void setOwner:(Entity *who_owns_entity)

◆ noteFrustration:

- (void) noteFrustration: (NSString *) context

Extends class ShipEntity.

Definition at line 2093 of file ShipEntity.m.

2953 :(NSString *)context
2954{
2955 [shipAI reactToMessage:@"FRUSTRATED" context:context];
2956 [self doScriptEvent:OOJSID("shipAIFrustrated") withArgument:context];
2957}

◆ refreshEscortPositions

- (void) refreshEscortPositions

Extends class ShipEntity.

Definition at line 9593 of file ShipEntity.m.

13791{
13792 if (!_escortPositionsValid)
13793 {
13794 JSContext *context = OOJSAcquireContext();
13795 jsval result;
13796 jsval args[] = { INT_TO_JSVAL(0), INT_TO_JSVAL(_maxEscortCount) };
13797 BOOL OK;
13798
13799 // Reset validity first so updateEscortFormation can be called from the update callback.
13800 _escortPositionsValid = YES;
13801
13802 uint8_t i;
13803 for (i = 0; i < _maxEscortCount; i++)
13804 {
13805 args[0] = INT_TO_JSVAL(i);
13806 OK = [script callMethod:OOJSID("coordinatesForEscortPosition")
13807 inContext:context
13808 withArguments:args count:sizeof args / sizeof *args
13809 result:&result];
13810
13811 if (OK) OK = JSValueToVector(context, result, &_escortPositions[i]);
13812
13813 if (!OK) _escortPositions[i] = kZeroVector;
13814 }
13815
13816 OOJSRelinquishContext(context);
13817 }
13818}
BOOL JSValueToVector(JSContext *context, jsval value, Vector *outVector) NONNULL_FUNC
Definition OOJSVector.m:259
OOINLINE JSContext * OOJSAcquireContext(void)
OOINLINE void OOJSRelinquishContext(JSContext *context)
const Vector kZeroVector
Definition OOVector.m:28

◆ rescaleBy:

- (void) rescaleBy: (GLfloat) factor

Extends class ShipEntity.

Definition at line 7619 of file ShipEntity.m.

9043 :(GLfloat)factor
9044{
9045 [self rescaleBy:factor writeToCache:YES];
9046}

◆ rescaleBy:writeToCache:

- (void) rescaleBy: (GLfloat) factor
writeToCache: (BOOL) writeToCache 

Extends class ShipEntity.

Definition at line 7619 of file ShipEntity.m.

9049 :(GLfloat)factor writeToCache:(BOOL)writeToCache
9050{
9051 _scaleFactor *= factor;
9052 OOMesh *mesh = nil;
9053
9054 NSDictionary *shipDict = [self shipInfoDictionary];
9055 NSString *modelName = [shipDict oo_stringForKey:@"model"];
9056 if (modelName != nil)
9057 {
9058 mesh = [OOMesh meshWithName:modelName
9059 cacheKey:[NSString stringWithFormat:@"%@-%.3f",_shipKey,_scaleFactor]
9060 materialDictionary:[shipDict oo_dictionaryForKey:@"materials"]
9061 shadersDictionary:[shipDict oo_dictionaryForKey:@"shaders"]
9062 smooth:[shipDict oo_boolForKey:@"smooth" defaultValue:NO]
9063 shaderMacros:OODefaultShipShaderMacros()
9065 scaleFactor:factor
9066 cacheWriteable:writeToCache];
9067
9068 if (mesh == nil) return;
9069 [self setMesh:mesh];
9070 }
9071
9072 // rescale subentities
9074 foreach (se, [self subEntities])
9075 {
9076 [se setPosition:HPvector_multiply_scalar([se position], factor)];
9077 [se rescaleBy:factor writeToCache:writeToCache];
9078 }
9079
9080 // rescale mass
9081 mass *= factor * factor * factor;
9082}
HPVector position
Definition Entity.h:112
void setPosition:(HPVector posn)
Definition Entity.m:647
instancetype meshWithName:cacheKey:materialDictionary:shadersDictionary:smooth:shaderMacros:shaderBindingTarget:scaleFactor:cacheWriteable:(NSString *name,[cacheKey] NSString *cacheKey,[materialDictionary] NSDictionary *materialDict,[shadersDictionary] NSDictionary *shadersDict,[smooth] BOOL smooth,[shaderMacros] NSDictionary *macros,[shaderBindingTarget] id< OOWeakReferenceSupport > object,[scaleFactor] float factor,[cacheWriteable] BOOL cacheWriteable)
Definition OOMesh.m:252

◆ setShipHitByLaser:

- (void) setShipHitByLaser: (ShipEntity *) ship

Extends class ShipEntity.

Definition at line 9593 of file ShipEntity.m.

10182 :(ShipEntity *)ship
10183{
10184 if (ship != [self shipHitByLaser])
10185 {
10186 [_shipHitByLaser release];
10187 _shipHitByLaser = [ship weakRetain];
10188 }
10189}

◆ setUpMixedEscorts

- (void) setUpMixedEscorts

Extends class ShipEntity.

Definition at line 14954 of file ShipEntity.m.

1791{
1792 NSArray *escortRoles = [shipinfoDictionary oo_arrayForKey:@"escort_roles" defaultValue:nil];
1793 if (escortRoles == nil)
1794 {
1795 OOLogWARN(@"eship.setUp.escortShipRoles",
1796 @"Ship %@ has bad escort_roles definition.", self);
1797 return;
1798 }
1799 NSEnumerator *edefEnumerator = nil;
1800 NSDictionary *escortDefinition = nil;
1801 NSDictionary *systeminfo = nil;
1802 OOGovernmentID government;
1803
1804 systeminfo = [UNIVERSE currentSystemData];
1805 government = [systeminfo oo_unsignedCharForKey:KEY_GOVERNMENT];
1806
1807 OOShipGroup *escortGroup = [self escortGroup];
1808 if ([self group] == nil)
1809 {
1810 [self setGroup:escortGroup]; // should probably become a copy of the escortGroup post NMSR.
1811 }
1812 [escortGroup setLeader:self];
1813 _maxEscortCount = MAX_ESCORTS;
1814 [self refreshEscortPositions];
1815
1816 uint8_t currentEscortCount = [escortGroup count] - 1; // always at least 0
1817
1818 _maxEscortCount = 0;
1819 int8_t i = 0;
1820 for (edefEnumerator = [escortRoles objectEnumerator]; (escortDefinition = [edefEnumerator nextObject]); )
1821 {
1822 if (currentEscortCount >= MAX_ESCORTS)
1823 {
1824 break;
1825 }
1826 // int rather than uint because, at least for min, there is a
1827 // use to giving a negative value
1828 int8_t min = [escortDefinition oo_intForKey:@"min" defaultValue:0];
1829 int8_t max = [escortDefinition oo_intForKey:@"max" defaultValue:2];
1830 NSString *escortRole = [escortDefinition oo_stringForKey:@"role" defaultValue:@"escort"];
1831 int8_t desired = max;
1832 if (min < desired)
1833 {
1834 for (i = min ; i < max ; i++)
1835 {
1836 if (Ranrot()%11 < government+2)
1837 {
1838 desired--;
1839 }
1840 }
1841 }
1842 for (i = 0; i < desired; i++)
1843 {
1844 if (currentEscortCount >= MAX_ESCORTS)
1845 {
1846 break;
1847 }
1848 if (![escortRole isEqualToString:@""])
1849 {
1850 HPVector ex_pos = [self coordinatesForEscortPosition:currentEscortCount];
1851 ShipEntity *escorter = [UNIVERSE newShipWithRole:escortRole]; // retained
1852 if (escorter == nil)
1853 {
1854 break;
1855 }
1856 [self setUpOneEscort:escorter inGroup:escortGroup withRole:escortRole atPosition:ex_pos andCount:currentEscortCount];
1857 [escorter release];
1858 }
1859 currentEscortCount++;
1860 _maxEscortCount++;
1861 }
1862 }
1863 // done assigning escorts
1864 _pendingEscortCount = 0;
1865}
#define OOLogWARN(class, format,...)
Definition OOLogging.h:113
uint8_t OOGovernmentID
Definition OOTypes.h:206
void setLeader:(ShipEntity *leader)
NSUInteger count()
unsigned Ranrot(void)

◆ setUpOneEscort:inGroup:withRole:atPosition:andCount:

- (void) setUpOneEscort: (ShipEntity *) escorter
inGroup: (OOShipGroup *) escortGroup
withRole: (NSString *) escortRole
atPosition: (HPVector) ex_pos
andCount: (uint8_t) currentEscortCount 

Extends class ShipEntity.

Definition at line 14954 of file ShipEntity.m.

1868 :(ShipEntity *)escorter inGroup:(OOShipGroup *)escortGroup withRole:(NSString *)escortRole atPosition:(HPVector)ex_pos andCount:(uint8_t)currentEscortCount
1869{
1870 NSString *autoAI = nil;
1871 NSString *pilotRole = nil;
1872 NSDictionary *autoAIMap = nil;
1873 NSDictionary *escortShipDict = nil;
1874 AI *escortAI = nil;
1875 NSString *defaultRole = @"escort";
1876
1877 if ([self isPolice])
1878 {
1879 defaultRole = @"wingman";
1880 pilotRole = @"police"; // police are always insured.
1881 }
1882 else
1883 {
1884 pilotRole = bounty ? @"pirate" : @"hunter"; // hunters have insurancies, pirates not.
1885 }
1886
1887 double dd = escorter->collision_radius;
1888
1889 if (EXPECT(currentEscortCount < (uint8_t)MAX_ESCORTS))
1890 {
1891 // spread them around a little randomly
1892 ex_pos.x += dd * 6.0 * (randf() - 0.5);
1893 ex_pos.y += dd * 6.0 * (randf() - 0.5);
1894 ex_pos.z += dd * 6.0 * (randf() - 0.5);
1895 }
1896 else
1897 {
1898 // Thargoid armada(!) Add more distance between the 'escorts'.
1899 ex_pos.x += dd * 12.0 * (randf() - 0.5);
1900 ex_pos.y += dd * 12.0 * (randf() - 0.5);
1901 ex_pos.z += dd * 12.0 * (randf() - 0.5);
1902 }
1903
1904 [escorter setPosition:ex_pos]; // minimise lollipop flash
1905
1906 if ([escorter crew] == nil)
1907 {
1908 [escorter setSingleCrewWithRole:pilotRole];
1909 }
1910
1911 [escorter setPrimaryRole:defaultRole]; //for mothership
1912 // in case this hasn't yet been set, make sure escorts get a real scan class
1913 // shouldn't happen very often, but is possible
1914 if (scanClass == CLASS_NOT_SET)
1915 {
1916 scanClass = CLASS_NEUTRAL;
1917 }
1918 [escorter setScanClass:scanClass]; // you are the same as I
1919
1920 if ([self bounty] == 0) [escorter setBounty:0 withReason:kOOLegalStatusReasonSetup]; // Avoid dirty escorts for clean mothers
1921
1922 // find the right autoAI.
1923 escortShipDict = [escorter shipInfoDictionary];
1924 autoAIMap = [ResourceManager dictionaryFromFilesNamed:@"autoAImap.plist" inFolder:@"Config" andMerge:YES];
1925 autoAI = [autoAIMap oo_stringForKey:defaultRole];
1926 if (autoAI==nil) // no 'wingman' defined in autoAImap?
1927 {
1928 autoAI = [autoAIMap oo_stringForKey:@"escort" defaultValue:@"nullAI.plist"];
1929 }
1930
1931 escortAI = [escorter getAI];
1932
1933 // Let the populator decide which AI to use, unless we have a working alternative AI & we specify auto_ai = NO !
1934 if ( (escortRole && [escortShipDict oo_fuzzyBooleanForKey:@"auto_ai" defaultValue:YES])
1935 || ([[escortAI name] isEqualToString: @"nullAI.plist"] && ![autoAI isEqualToString:@"nullAI.plist"]) )
1936 {
1937 [escorter switchAITo:autoAI];
1938 }
1939
1940 [escorter setGroup:escortGroup];
1941 [escorter setOwner:self]; // mark self as group leader
1942
1943
1944 if ([self status] == STATUS_DOCKED)
1945 {
1946 [[self owner] addShipToLaunchQueue:escorter withPriority:NO];
1947 }
1948 else
1949 {
1950 [UNIVERSE addEntity:escorter]; // STATUS_IN_FLIGHT, AI state GLOBAL
1951 [escortAI setState:@"FLYING_ESCORT"]; // Begin escort flight. (If the AI doesn't define FLYING_ESCORT, this has no effect.)
1952 [escorter doScriptEvent:OOJSID("spawnedAsEscort") withArgument:self];
1953 }
1954
1955 if([escorter heatInsulation] < [self heatInsulation]) [escorter setHeatInsulation:[self heatInsulation]]; // give escorts same protection as mother.
1956 if(([escorter maxFlightSpeed] < cruiseSpeed) && ([escorter maxFlightSpeed] > cruiseSpeed * 0.3))
1957 cruiseSpeed = [escorter maxFlightSpeed] * 0.99; // adapt patrolSpeed to the slowest escort but ignore the very slow ones.
1958
1959
1960 if (bounty)
1961 {
1962 int extra = 1 | (ranrot_rand() & 15);
1963 // if mothership is offender, make sure escorter is too.
1964 [escorter markAsOffender:extra withReason:kOOLegalStatusReasonSetup];
1965 }
1966 else
1967 {
1968 // otherwise force the escort to be clean
1969 [escorter setBounty:0 withReason:kOOLegalStatusReasonSetup];
1970 }
1971
1972}
#define EXPECT(x)
Definition AI.h:38
void setState:(NSString *stateName)
Definition AI.m:334
GLfloat collision_radius
Definition Entity.h:111
void setScanClass:(OOScanClass sClass)
Definition Entity.m:799
NSDictionary * dictionaryFromFilesNamed:inFolder:andMerge:(NSString *fileName,[inFolder] NSString *folderName,[andMerge] BOOL mergeFiles)
void setBounty:withReason:(OOCreditsQuantity amount,[withReason] OOLegalStatusReason reason)
NSDictionary * shipInfoDictionary()
void setSingleCrewWithRole:(NSString *crewRole)
void setGroup:(OOShipGroup *group)
void setPrimaryRole:(NSString *role)
void markAsOffender:withReason:(int offence_value,[withReason] OOLegalStatusReason reason)
void doScriptEvent:withArgument:(jsid message,[withArgument] id argument)
float randf(void)
#define ranrot_rand()

◆ setUpOneFlasher:

- (BOOL) setUpOneFlasher: (NSDictionary *) subentDict

Extends class ShipEntity.

Definition at line 14954 of file ShipEntity.m.

926 :(NSDictionary *) subentDict
927{
929 [flasher setPosition:HPvector_multiply_scalar([subentDict oo_hpvectorForKey:@"position"],_scaleFactor)];
930 [flasher rescaleBy:_scaleFactor];
931 [self addSubEntity:flasher];
932 return YES;
933}
instancetype flasherWithDictionary:(NSDictionary *dictionary)
void rescaleBy:(GLfloat factor)

◆ setUpOneSubentity:

- (BOOL) setUpOneSubentity: (NSDictionary *) subentDict

Extends class ShipEntity.

Definition at line 14954 of file ShipEntity.m.

906 :(NSDictionary *) subentDict
907{
909
910 NSString *type = nil;
911
912 type = [subentDict oo_stringForKey:@"type"];
913 if ([type isEqualToString:@"flasher"])
914 {
915 return [self setUpOneFlasher:subentDict];
916 }
917 else
918 {
919 return [self setUpOneStandardSubentity:subentDict asTurret:[type isEqualToString:@"ball_turret"]];
920 }
921
923}
#define OOJS_PROFILE_EXIT
#define OOJS_PROFILE_ENTER

◆ subEntityDied:

- (void) subEntityDied: (ShipEntity *) sub

Extends class ShipEntity.

Definition at line 7619 of file ShipEntity.m.

9520 :(ShipEntity *)sub
9521{
9522 if ([self subEntityTakingDamage] == sub) [self setSubEntityTakingDamage:nil];
9523
9524 [sub setOwner:nil];
9525 // TODO? Recalculating collision radius should increase collision testing efficiency,
9526 // but for most ship models the difference would be marginal. -- Kaks 20110429
9527 mass -= [sub mass]; // missing subents affect fuel charge rate, etc..
9528 [subEntities removeObject:sub];
9529}

◆ subEntityReallyDied:

- (void) subEntityReallyDied: (ShipEntity *) sub

Extends class ShipEntity.

Definition at line 7619 of file ShipEntity.m.

9532 :(ShipEntity *)sub
9533{
9534 if ([self subEntityTakingDamage] == sub) [self setSubEntityTakingDamage:nil];
9535
9536 if ([self hasSubEntity:sub])
9537 {
9538 OOLogERR(@"shipEntity.bug.subEntityRetainUnderflow", @"Subentity of %@ died while still in subentity list! This is bad. Leaking subentity list to avoid crash. %@", self, @"This is an internal error, please report it.");
9539
9540 // Leak subentity list.
9541 subEntities = nil;
9542 }
9543}
#define OOLogERR(class, format,...)
Definition OOLogging.h:112

The documentation for this category was generated from the following file: