Djomanix / bwapi

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

Details on a geyser are incorrect after a refinery on it has been destroyed #220

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Play a game and have the enemy steal your gas
2. After destroying it, its details either don't change or are incorrect

Unsure whether it affects all races / refineries but it was experienced with 
the bot playing Protoss and a 
Terran enemy building a refinery in the bots base.

What is the expected output? What do you see instead?

BWAPI::Broodwar->canBuildHere(NULL, geyser->getTilePosition(), 
BWAPI::Broodwar->self()-
>getRace().getRefinery()) returns false on the empty geyser afterwards

What version of the product are you using? On what operating system?
r2255 on Windows 7 x64

Original issue reported on code.google.com by quaver.smith on 30 May 2010 at 2:07

GoogleCodeExporter commented 9 years ago
Also the same method returns false for terran building which support an addon 
where
the addon is already built there, e.g.
BWAPI::Broodwar->canBuildHere(NULL, BWAPI::TilePosition(101, 10),
BWAPI::UnitTypes::Terran_Factory) returns 0 when there is an addon at pos(105, 
11)
and returns 1 if there is no addon at 105, 11

Original comment by krasi...@gmail.com on 30 May 2010 at 3:20

GoogleCodeExporter commented 9 years ago
This is probably related to the problem i was having before, here:
http://code.google.com/p/bwsal/issues/detail?id=22

Surely if the addon already exists then you cannont build on that tile 
anymore...so
returning false would be the correct behaviour...no?

Original comment by Kali...@gmail.com on 30 May 2010 at 6:48

GoogleCodeExporter commented 9 years ago

Original comment by lowerlo...@gmail.com on 31 May 2010 at 10:17

GoogleCodeExporter commented 9 years ago
I cannot recreate the problem. This is what I did in my attempt to recreate the 
problem:
1) Started a network game.
2) Got the Terran player to build a refinery at the geyser in the Protoss's 
base.
3) Destroyed the refinery with probes
4) After destroying it, the tile position canBuildHere for the geyser's tile 
position and unit type Protoss_Assimilator returned true.

Based on the scarce details provided in quaver.smith's original post, I bet he 
was calling getTilePosition on the original geyser object, which of course is 
destroyed when the Refinery is destroyed because the refinery is the geyser 
(they are the same unit). Since the geyser object no longer existed, 
geyser->getTilePosition() returned TilePositions::Unknown, as is the case with 
any non-existent unit. So he was supplying TilePositions::Unknown to the 
canBuildHere function, which explains why it was returning false.

Marked as WontFix since this is not a problem with BWAPI.

Original comment by lowerlo...@gmail.com on 23 Jul 2010 at 1:55