Ticket #3284: attack_patch.diff

File attack_patch.diff, 610 bytes (added by Karamel, 9 years ago)

Static attack preference for best attack

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

     
    315315 */
    316316Attack.prototype.GetBestAttack = function()
    317317{
     318    // Static order workaround
     319    var best = ["Ranged", "Melee", "Capture"];
     320    var types = this.GetAttackTypes();
     321    for (var key in best) {
     322        if (types.indexOf(best[key]) != -1) return best[key];
     323    }
    318324    return this.GetAttackTypes().pop();
    319325};
    320326