From f4e872077afd6f7aab6a1ec3af1e175c6ca2837e Mon Sep 17 00:00:00 2001 From: Eric Walch Date: Sat, 24 Apr 2010 08:32:23 +0000 Subject: [PATCH] - Increased the strength of the Constrictor a bit when fighting against more experienced players. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3210 127b21dd-08f5-0310-b4b7-95ae10353056 --- Resources/Scripts/oolite-constrictor.js | 3 +++ src/Core/Universe.m | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Resources/Scripts/oolite-constrictor.js b/Resources/Scripts/oolite-constrictor.js index 6bd287be..b0527902 100644 --- a/Resources/Scripts/oolite-constrictor.js +++ b/Resources/Scripts/oolite-constrictor.js @@ -42,6 +42,9 @@ this.shipSpawned = function () { this.legalPoints = this.ship.bounty; this.ship.bounty = 0; + if (player.score > 512) this.ship.awardEquipment("EQ_SHIELD_BOOSTER"); // Player is Dangerous + if (player.score > 2560) this.ship.awardEquipment("EQ_SHIELD_ENHANCER"); // Player is Deadly + this.ship.energy = this.ship.maxEnergy; // start with all energy banks full. }; diff --git a/src/Core/Universe.m b/src/Core/Universe.m index 27e53bb7..b4a04cbc 100644 --- a/src/Core/Universe.m +++ b/src/Core/Universe.m @@ -4687,11 +4687,18 @@ static BOOL MaintainLinkedLists(Universe* uni) &&(v_off.x < cr)&&(v_off.x > -cr)&&(v_off.y < cr)&&(v_off.y > -cr) // AND not off to one side or another &&(v_off.x*v_off.x + v_off.y*v_off.y < cr*cr)) // AND not off to both sides { + + /* + // EW 23-4-2002: Below used to be a test for: e2->actual_radius with Oolite 1.65. + // With e2->collision_radius it is now just duplicating the test above. + // Remove the code or use something smaller to check (if possible). + // within the bounding sphere - do further tests GLfloat ar = e2->collision_radius; if ((v_off.z > 0.0)&&(v_off.z < nearest + ar) // ahead AND within range &&(v_off.x < ar)&&(v_off.x > -ar)&&(v_off.y < ar)&&(v_off.y > -ar) // AND not off to one side or another &&(v_off.x*v_off.x + v_off.y*v_off.y < ar*ar)) // AND not off to both sides + */ { ShipEntity* entHit = (ShipEntity*)nil; GLfloat hit = [(ShipEntity*)e2 doesHitLine:p0:p1:&entHit]; // octree detection @@ -4714,7 +4721,8 @@ static BOOL MaintainLinkedLists(Universe* uni) if (hit_entity) { result = [hit_entity universalID]; - if (hit_subentity) [hit_entity setSubEntityTakingDamage:hit_subentity]; + // I think the above code does not guarantee that the closest hit_subentity belongs to the closest hit_entity. + if (hit_subentity && [hit_subentity owner] == hit_entity) [hit_entity setSubEntityTakingDamage:hit_subentity]; if (range_ptr != NULL) {