google-code-export / bwapi

Automatically exported from code.google.com/p/bwapi
0 stars 0 forks source link

Icorrect Unit.isGatheringGas() behaviour #168

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In onFrame() callback insert the code like this:
    static Unit* gasing = NULL;
    if (gasing == NULL)
    {
        set<Unit*> myUnits = Broodwar->self()->getUnits();
        for (setUnit_ci i = myUnits.begin(); i != myUnits.end(); i+
+)
            if ((*i)->getType().isWorker() && (*i)-
>isGatheringGas())
                // set gasing unit
            {
                gasing = *i;
                break;
            }
    } else
    {
        if (!gasing->isGatheringGas())
            Broodwar->printf("Gasing is not gasing!");
    }

2. Start the game as Zerg, build Spawning pool and Extractor, gather 
resources for upgrade to Zerg Lair
3. Start gathering gas
4. Morph Hatchery to Lair

What is the expected output? What do you see instead?
Expected to simply gather gas, no output.
Instead each time drone puts the gas its carrying into morphing hatchery, 
"Gasing is not gasing" appears.

What version of the product are you using? On what operating system?
Publicly available BWAPI 2.4 beta

Please provide any additional information below.

Original issue reported on code.google.com by tai...@nm.ru on 16 Dec 2009 at 12:06

GoogleCodeExporter commented 9 years ago
I've added an example code which you can simply place into ExampleAIModule 
project 
and compile.

Original comment by tai...@nm.ru on 16 Dec 2009 at 2:56

Attachments:

GoogleCodeExporter commented 9 years ago
I compiled your code and it definitely does what you say, but it also says it 
every
frame where the first drone is not harvesting which is the intention I suppose. 
Looks
like there might be a particular state involved there which is not checked in
isGatheringGas()

Original comment by nicholas...@gmail.com on 18 Dec 2009 at 3:27

GoogleCodeExporter commented 9 years ago

Original comment by lowerlo...@gmail.com on 20 Dec 2009 at 8:34

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1818.

Original comment by lowerlo...@gmail.com on 20 Dec 2009 at 8:52