diff --git a/Doc/CHANGELOG.TXT b/Doc/CHANGELOG.TXT index af415731..5dd325fc 100644 --- a/Doc/CHANGELOG.TXT +++ b/Doc/CHANGELOG.TXT @@ -16,6 +16,7 @@ Changes between Oolite 1.77 and Oolite 1.77.1: * Reasonably skilled pilots will now remember to look where they're going when fleeing * Shields now also protect subentities +* Edge-case for damage to main station fixed ------------------------------------------------------------------------------- diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index 3207bd18..ade2d9a3 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -4907,6 +4907,14 @@ static GLfloat sBaseMass = 0.0; { if (other == nil || [other isSubEntity]) return; + if (other == [UNIVERSE station]) + { + // there is no way the player can destroy the main station + // and so the explosion will be cancelled, so there shouldn't + // be a kill award + return; + } + OOCreditsQuantity score = 10 * [other bounty]; OOScanClass killClass = [other scanClass]; // **tgape** change (+line) BOOL killAward = [other countsAsKill]; @@ -4929,7 +4937,7 @@ static GLfloat sBaseMass = 0.0; } } } - + credits += score; if (score > 9) diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index 97b5978c..cda2c92d 100644 --- a/src/Core/Entities/ShipEntity.m +++ b/src/Core/Entities/ShipEntity.m @@ -11538,12 +11538,16 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q [self noteTakingDamage:amount from:other type:damageType]; if (cascade) energy = 0.0; // explicit set energy to zero in case an oxp raised the energy in previous line. } - + // die if I'm out of energy if (energy <= 0.0) { - if (hunter != nil) [hunter noteTargetDestroyed:self]; - [self getDestroyedBy:other damageType:damageType]; + // backup check just in case scripts have reduced energy + if (self != [UNIVERSE station]) + { + if (hunter != nil) [hunter noteTargetDestroyed:self]; + [self getDestroyedBy:other damageType:damageType]; + } } else {