Ticket #4507: patch.diff

File patch.diff, 1.1 KB (added by fatherbushido, 7 years ago)

Simple fix. Needs to figure if that approach is better than an owner check in the calling code.

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

     
    55    "<a:example>" +
    66        "<Amount>1000</Amount>" +
    77        "<Type>food.meat</Type>" +
     8        "<KillBeforeGather>false</KillBeforeGather>" +
     9        "<MaxGatherers>25</MaxGatherers>" +
     10        "<DiminishingReturns>0.8</DiminishingReturns>" +
    811    "</a:example>" +
    912    "<element name='KillBeforeGather' a:help='Whether this entity must be killed (health reduced to 0) before its resources can be gathered'>" +
    1013        "<data type='boolean'/>" +
     
    120123
    121124ResourceSupply.prototype.IsAvailable = function(player, gathererID)
    122125{
    123     if (this.GetNumGatherers() < this.GetMaxGatherers() || this.gatherers[player].indexOf(gathererID) !== -1)
     126    if (this.amount !== 0 && (this.GetNumGatherers() < this.GetMaxGatherers() || this.gatherers[player].indexOf(gathererID) !== -1))
    124127        return true;
    125128    return false;
    126129};