Closed GoogleCodeExporter closed 9 years ago
I might be wrong about onUnitDestroy() not being called but onUnitMorph() and
onUnitCreate() are still wrong, this is the code I used to test it:
std::map<int, std::pair<BWAPI::Player*, BWAPI::UnitType>> theMap;
void BasicAIModule::onUnitCreate( BWAPI::Unit* unit )
{
theMap[unit->getID()] = std::make_pair(unit->getPlayer(), unit->getType());
}
void BasicAIModule::onUnitMorph(BWAPI::Unit* unit)
{
if(theMap.find(unit->getID()) != theMap.end())
{
BWAPI::Broodwar->printf("Unit was: %s", theMap[unit-
>getID()].second.getName().c_str());
BWAPI::Broodwar->printf("Unit is now: %s", unit-
>getType().getName().c_str());
}
}
And this is one result of it: http://i.imgur.com/b7azH.jpg
Siege tank morphing into an SCV :D
Original comment by quaver.smith
on 4 Feb 2010 at 6:00
Original comment by AHeinerm
on 6 Feb 2010 at 3:34
Original comment by AHeinerm
on 7 Mar 2010 at 5:00
Please verify if this issue still exists in r2126.
Original comment by AHeinerm
on 7 Mar 2010 at 10:32
Looks like it's fixed now, haven't seen it happen since changing to 2.7.1
Original comment by quaver.smith
on 21 May 2010 at 1:37
Cool
Original comment by lowerlo...@gmail.com
on 21 May 2010 at 5:05
Original issue reported on code.google.com by
quaver.smith
on 3 Feb 2010 at 9:21