Ticket #1422: gather-treasures.patch

File gather-treasures.patch, 2.4 KB (added by Deiz, 12 years ago)
  • binaries/data/mods/public/gui/session/input.js

    diff --git a/binaries/data/mods/public/gui/session/input.js b/binaries/data/mods/public/gui/session/input.js
    index 189a368..c716774 100644
    a b function getActionInfo(action, target)  
    229229        }
    230230        else if (targetState.resourceSupply)
    231231        {
    232             var resourceType = targetState.resourceSupply.type.specific;
     232            var resourceType = targetState.resourceSupply.type;
    233233            if (targetState.resourceSupply.type.generic === "treasure")
    234234            {
    235235                cursor = "action-gather-" + targetState.resourceSupply.type.generic;
  • binaries/data/mods/public/simulation/components/UnitAI.js

    diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js
    index 2d38f61..f94897e 100644
    a b var UnitFsmSpec = {  
    942942                        var nearby = this.FindNearbyResource(function (ent, type, template) {
    943943                            return (
    944944                                ent != oldTarget
    945                                 && type.specific == oldType.specific
    946                                 && (type.specific != "meat" || oldTemplate == template)
     945                                && ((type.generic == "treasure" && oldType.generic == "treasure")
     946                                || (type.specific == oldType.specific
     947                                && (type.specific != "meat" || oldTemplate == template)))
    947948                            );
    948949                        });
    949950                        if (nearby)
    var UnitFsmSpec = {  
    977978                    // Also don't switch to a different type of huntable animal
    978979                    var nearby = this.FindNearbyResource(function (ent, type, template) {
    979980                        return (
    980                             type.specific == resourceType
    981                             && (type.specific != "meat" || resourceTemplate == template)
     981                            (type.generic == "treasure" && resourceType.generic == "treasure")
     982                            || (type.specific == resourceType.specific
     983                            && (type.specific != "meat" || resourceTemplate == template))
    982984                        );
    983985                    });
    984986
    var UnitFsmSpec = {  
    11261128                    // Also don't switch to a different type of huntable animal
    11271129                    var nearby = this.FindNearbyResource(function (ent, type, template) {
    11281130                        return (
    1129                             type.specific == resourceType.specific
    1130                             && (type.specific != "meat" || resourceTemplate == template)
     1131                            (type.generic == "treasure" && resourceType.generic == "treasure")
     1132                            || (type.specific == resourceType.specific
     1133                            && (type.specific != "meat" || resourceTemplate == template))
    11311134                        );
    11321135                    });
    11331136                    if (nearby)