Ticket #3533: 3533.diff

File 3533.diff, 740 bytes (added by Stan, 9 years ago)

A proposal

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

     
    328328    return ret;
    329329};
    330330
    331 /**
    332  * Return the type of the best attack.
    333  * TODO: this should probably depend on range, target, etc,
    334  * so we can automatically switch between ranged and melee
    335  */
    336 Attack.prototype.GetBestAttack = function()
    337 {
    338     return this.GetAttackTypes().pop();
    339 };
    340 
    341331Attack.prototype.GetBestAttackAgainst = function(target, allowCapture)
    342332{
    343333    var cmpFormation = Engine.QueryInterface(target, IID_Formation);