Ticket #2136: patch_collecttreasure.diff
File patch_collecttreasure.diff, 2.3 KB (added by , 11 years ago) |
---|
-
binaries/data/mods/public/simulation/components/UnitAI.js
1577 1577 var nearby = this.FindNearbyResource(function (ent, type, template) { 1578 1578 return ( 1579 1579 ent != oldTarget 1580 && ((type.generic == "treasure" && oldType.generic == "treasure") 1581 || (type.specific == oldType.specific 1582 && (type.specific != "meat" || oldTemplate == template))) 1580 && (type.specific == oldType.specific 1581 && (type.specific != "meat" || oldTemplate == template)) 1583 1582 ); 1584 1583 }); 1585 1584 if (nearby) … … 1637 1636 var nearby = this.FindNearbyResource(function (ent, type, template) { 1638 1637 return ( 1639 1638 ent != oldTarget 1640 && ((type.generic == "treasure" && oldType.generic == "treasure") 1641 || (type.specific == oldType.specific 1642 && (type.specific != "meat" || oldTemplate == template))) 1639 && (type.specific == oldType.specific 1640 && (type.specific != "meat" || oldTemplate == template)) 1643 1641 ); 1644 1642 }); 1645 1643 if (nearby) … … 1680 1678 // Also don't switch to a different type of huntable animal 1681 1679 var nearby = this.FindNearbyResource(function (ent, type, template) { 1682 1680 return ( 1683 (type.generic == "treasure" && resourceType.generic == "treasure") 1684 || (type.specific == resourceType.specific 1685 && (type.specific != "meat" || resourceTemplate == template)) 1681 type.specific == resourceType.specific 1682 && (type.specific != "meat" || resourceTemplate == template) 1686 1683 ); 1687 1684 }); 1688 1685 … … 1872 1869 // Also don't switch to a different type of huntable animal 1873 1870 var nearby = this.FindNearbyResource(function (ent, type, template) { 1874 1871 return ( 1875 (type.generic == "treasure" && resourceType.generic == "treasure") 1876 || (type.specific == resourceType.specific 1877 && (type.specific != "meat" || resourceTemplate == template)) 1872 type.specific == resourceType.specific 1873 && (type.specific != "meat" || resourceTemplate == template) 1878 1874 ); 1879 1875 }); 1880 1876 if (nearby)