OoliteProject / oolite

The main Oolite repository.
https://www.oolite.space
567 stars 73 forks source link

dealEnergyDamageWithinDesiredRange AI method not dealing out damage #289

Closed phkb closed 6 years ago

phkb commented 6 years ago

Issue: Intercept Missile from "Missiles and Bombs" OXP (v2.5) does no damage to target Oolite version: 1.82 and following. Steps to reproduce:

  1. Start new game.
  2. On F3 screen, remove all existing pylon mounted weapons.
  3. From Debug Cosnole, enter: PS.awardEquipment("EQ_RMB_INTERCEPT_MISSILE")
  4. Launch from station, move away from it, then come to a halt.
  5. From Debug Console, enter: S.addShips("[barrel]", 1, PS.position.add(PS.vectorForward.multiply(5000)), 0)
  6. Target the cargo pod that was created in front of the ship.
  7. Fire the Intercept missile at the cargo pod.

In Oolite 1.80, the missile will hit and destroy the barrel. From version 1.82, you can fire as many Intercept missiles as you like, but the cargo pod won't be destroyed.

These tests were done in pristine Oolite installations (base install with no other OXP's in play, except for the Missiles and Bombs OXP v2.5).

The Intercept missile is using the dealEnergyDamageWithinDesiredRange AI method to do it's work. The function it certainly firing, because a warning will appear in the log about this method being deprecated. But it doesn't seem to be doing any damage.

phkb commented 6 years ago

I've just found a wiki page (http://wiki.alioth.net/index.php/OXP_standards#Missile_explosions) that indicates that the dealEnergyDamageWithinDesiredRange is bugged from v1.77.1. So the best solution may not be to fix the bug, but to change the OXP.