HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

So, they fixed the boolexpr bug?

02-26-2010, 11:56 PM#1
Vexorian
So, some person told me that this bug was fixed, I tested and apparently it was, note how it gives accurate unit counts even though we are not using return IsUnitType(GetFilterUnit(), ut) == true; in the filter.
Collapse Zinc:
library BoolexprTest
{
    unittype ut;
    string unitTypeName[];
    
    function createBunch(integer t, integer n) {
        real x,y;
        integer i;
        for ( 1 <= i <= n) {
            x = GetRandomReal(-1000, 1000);
            y = GetRandomReal(-1000, 1000);
            CreateUnit(Player(0), t, x,y, 0);
        }
    }
    
    function initNames() {
        unitTypeName[0] = "UNIT_TYPE_HERO";
        unitTypeName[1] = "UNIT_TYPE_DEAD";
        unitTypeName[2] = "UNIT_TYPE_STRUCTURE";
        
        unitTypeName[3] = "UNIT_TYPE_FLYING";
        unitTypeName[4] = "UNIT_TYPE_GROUND";
        
        unitTypeName[5] = "UNIT_TYPE_ATTACKS_FLYING";
        unitTypeName[6] = "UNIT_TYPE_ATTACKS_GROUND";
        
        unitTypeName[7] = "UNIT_TYPE_MELEE_ATTACKER";
        unitTypeName[8] = "UNIT_TYPE_RANGED_ATTACKER";
        
        unitTypeName[9] = "UNIT_TYPE_GIANT";
        unitTypeName[10] = "UNIT_TYPE_SUMMONED";
        unitTypeName[11] = "UNIT_TYPE_STUNNED";
        unitTypeName[12] = "UNIT_TYPE_PLAGUED";
        unitTypeName[13] = "UNIT_TYPE_SNARED";
        
        unitTypeName[14] = "UNIT_TYPE_UNDEAD";
        unitTypeName[15] = "UNIT_TYPE_MECHANICAL";
        unitTypeName[16] = "UNIT_TYPE_PEON";
        unitTypeName[17] = "UNIT_TYPE_SAPPER";
        unitTypeName[18] = "UNIT_TYPE_TOWNHALL";    
        unitTypeName[19] = "UNIT_TYPE_ANCIENT";
            
        unitTypeName[20] = "UNIT_TYPE_TAUREN";
        unitTypeName[21] = "UNIT_TYPE_POISONED";
        unitTypeName[22] = "UNIT_TYPE_POLYMORPHED";
        unitTypeName[23] = "UNIT_TYPE_SLEEPING";
        unitTypeName[24] = "UNIT_TYPE_RESISTANT";
        unitTypeName[25] = "UNIT_TYPE_ETHEREAL";
        unitTypeName[26] = "UNIT_TYPE_MAGIC_IMMUNE";
    }
    
    function onInit() {
        integer x;
        trigger t;
        group g=CreateGroup();
        unit u;
        integer y;
        initNames();
        createBunch('hfoo', 2);
        createBunch('hhou', 3);
        createBunch('hpea', 7);
        createBunch('Hpal', 1);
        createBunch('hspt', 5);
        TriggerSleepAction(0);
        for ( 0 <= x <= 26 ) {
            ut = ConvertUnitType(x);
            GroupClear(g);
            GroupEnumUnitsOfPlayer(g, Player(0), function()->boolean {
                return IsUnitType(GetFilterUnit(), ut);
            });
            y = 0;
            while(true) {
                u = FirstOfGroup(g);
                if( u == null ) {
                    break;
                }
                GroupRemoveUnit(g,u);
                y+=1;
            }
            BJDebugMsg(I2S(y)+" units of type "+unitTypeName[x] );
        }

    }
}

02-27-2010, 07:32 AM#2
cosmicat
Possibly a by-product of their fix to the bad-building-queue bug/exploit that apparently ruined Bnet for a couple of weeks. Total Wild Mass Guess, though.
02-27-2010, 08:41 AM#3
Troll-Brain
It seems to be fixed yeah.
http://www.wc3c.net/showpost.php?p=1098627&postcount=15

At least the ones i had notice which doesn't work without a "== true" , now works properly.

PS : The tags "//! zinc" ; "//! endzinc "are supposed to be mandatory ?
02-27-2010, 11:16 AM#4
Vexorian
Quote:
Originally Posted by Troll-Brain
It seems to be fixed yeah.
http://www.wc3c.net/showpost.php?p=1098627&postcount=15

At least the ones i had notice which doesn't work without a "== true" , now works properly.

PS : The tags "//! zinc" ; "//! endzinc "are supposed to be mandatory ?
In newgen yep, in real life you use //! import zinc "filename.zn"