Ticket #4169: t4169_health.diff

File t4169_health.diff, 498 bytes (added by bb, 8 years ago)

This seems to be caused by a missing check. The entity in the replay are fishes accidentaly being hit by targetting ships, which indeed have no health. (testing this patch with the replay gives a oos instead of error, which is obvious and harmless)

  • binaries/data/mods/public/simulation/components/Armour.js

     
    6363
    6464    // Reduce health
    6565    var cmpHealth = Engine.QueryInterface(this.entity, IID_Health);
     66    if (!cmpHealth)
     67        return { "killed": false, "change": 0 };
     68
    6669    return cmpHealth.Reduce(total);
    6770};
    6871