google-code-export / bwapi

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

crash on attackMove #154

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
the following code in onFrame causes a crash on the provided ums map:

  if (Broodwar->getFrameCount()%40!=0) return;
  for each(Unit* u in Broodwar->self()->getUnits())
  {
    if (u->getType()==UnitTypes::Terran_SCV)
    {
      u->attackMove(Position(u->getPosition().x()+100,u->getPosition().y()));
    }
  }

Original issue reported on code.google.com by lowerlo...@gmail.com on 30 Nov 2009 at 12:19

Attachments:

GoogleCodeExporter commented 9 years ago
crash occurs when the scv attacks the tank

Original comment by lowerlo...@gmail.com on 30 Nov 2009 at 12:21

GoogleCodeExporter commented 9 years ago
Looks like siege tank is the only enemy unit type that causes it to crash, but 
attack
moving other types of friendly units into it also cause a crash.

Original comment by lowerlo...@gmail.com on 30 Nov 2009 at 12:45

GoogleCodeExporter commented 9 years ago
doesn't crash when friendly unit is siege tank and enemy is scv (on random 
suicide
mission).

Original comment by lowerlo...@gmail.com on 30 Nov 2009 at 12:54

GoogleCodeExporter commented 9 years ago
Might be related to the unit's turret (subunit).

Original comment by AHeinerm on 30 Nov 2009 at 5:14

GoogleCodeExporter commented 9 years ago
I am testing it now but I think Dark Archons also trigger the crash as well as 
just 
right clicking on the siege tank and Dark Archons.

Original comment by quaver.smith on 30 Nov 2009 at 10:45

GoogleCodeExporter commented 9 years ago
crash is in  std::string UnitImpl::getName()
on

sprintf_s(orderTargetIndex, 50, "OrderTarget:[%d](%s)",
(int)(this->getOrderTarget()), 
this->getOrderTarget()->getType().getName().c_str());

Original comment by caus...@googlemail.com on 1 Dec 2009 at 3:33

GoogleCodeExporter commented 9 years ago
String is limited to 50 characters, while the string I get is 52 characters... 
I'll
try to boost a bit all the 50 characters limit for char arrays / sprintf

Original comment by emartel@gmail.com on 2 Dec 2009 at 12:46

GoogleCodeExporter commented 9 years ago

Original comment by emartel@gmail.com on 2 Dec 2009 at 1:35