diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index ac34de16..d748b3ce 100644 --- a/src/Core/Entities/ShipEntity.m +++ b/src/Core/Entities/ShipEntity.m @@ -5678,7 +5678,7 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q ParticleEntity *fragment; OOCargoQuantity n_cargo = (ranrot_rand() % (likely_cargo + 1)); OOCargoQuantity cargo_to_go; - + if ([self status] == STATUS_DEAD) return; [self setStatus:STATUS_DEAD]; @@ -5689,7 +5689,7 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q [[PlayerEntity sharedPlayer] setScriptTarget:self]; [self doScriptEvent:@"shipDied"]; // FIXME: params missing } - + // two parts to the explosion: // 1. fast sparks float how_many = factor; @@ -5709,8 +5709,7 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q [fragment release]; how_many -= 1.0f; } - - + // we need to throw out cargo at this point. unsigned cargo_chance = 10; if ([[name lowercaseString] rangeOfString:@"medical"].location != NSNotFound) diff --git a/src/Core/Universe.m b/src/Core/Universe.m index b73b459c..665abe16 100644 --- a/src/Core/Universe.m +++ b/src/Core/Universe.m @@ -4288,7 +4288,7 @@ static BOOL MaintainLinkedLists(Universe* uni) - (BOOL) removeEntity:(Entity *) entity { - if (entity) + if (entity != nil && ![entity isPlayer]) { /* Ensure entity won't actually be dealloced until the end of this update (or the next update if none is in progress), because @@ -5541,7 +5541,7 @@ OOINLINE BOOL EntityInRange(Vector p1, Entity *e2, float range) #ifndef NDEBUG update_stage = [NSString stringWithFormat:@"update:entity[%@]", [thing shortDescription]]; #endif - if (![thing isPlayer] && EXPECT_NOT([thing status] == STATUS_DEAD && ![entitiesDeadThisUpdate containsObject:thing])) + if (EXPECT_NOT([thing status] == STATUS_DEAD && ![entitiesDeadThisUpdate containsObject:thing] && ![thing isPlayer])) { if (zombies == nil) zombies = [NSMutableSet set]; [zombies addObject:thing];