Ticket #3611: mauryanHouse-v2.patch

File mauryanHouse-v2.patch, 1.7 KB (added by mimo, 8 years ago)
  • binaries/data/mods/public/globalscripts/Templates.js

     
    3333 * @param match Either a string in the form
    3434 *     "Class1 Class2+Class3"
    3535 * where spaces are handled as OR and '+'-signs as AND,
     36 * and ! is handled as NOT, thus Class1+!Class2 = Class1 AND NOT Class2
    3637 * Or a list in the form
    3738 *     [["Class1"], ["Class2", "Class3"]]
    3839 * where the outer list is combined as OR, and the inner lists are AND-ed
     
    5657        // if the elements are still strings, split them by space or by '+'
    5758        if (typeof sublist == "string")
    5859            sublist = sublist.split(/[+\s]+/);
    59         if (sublist.every(function(c) { return classes.indexOf(c) != -1; }))
     60        if (sublist.every(function(c) {
     61            if (c.charAt(0) == "!")
     62                return classes.indexOf(c.substr(1)) == -1;
     63            return classes.indexOf(c) != -1;
     64        }))
    6065            return true;
    6166    }
    6267
  • binaries/data/mods/public/simulation/templates/template_structure_civic_house.xml

     
    2222    <BuffHeal>0</BuffHeal>
    2323    <EjectHealth>0.1</EjectHealth>
    2424    <EjectClassesOnDestroy datatype="tokens">Unit</EjectClassesOnDestroy>
    25     <List datatype="tokens">Support</List>
     25    <List datatype="tokens">Support+!Elephant</List>
    2626    <LoadingRange>1</LoadingRange>
    2727  </GarrisonHolder>
    2828  <Health>