Skip to content

Commit

Permalink
Fix bug of placing loaded ammo on ground
Browse files Browse the repository at this point in the history
  • Loading branch information
Yankes committed Aug 20, 2017
1 parent 88c4cb8 commit 5e97b19
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Battlescape/BattlescapeGenerator.cpp
Expand Up @@ -481,11 +481,14 @@ void BattlescapeGenerator::nextStage()
for (std::vector<BattleItem*>::iterator i = takeToNextStage.begin(); i != takeToNextStage.end(); ++i)
{
_save->getItems()->push_back(*i);
_craftInventoryTile->addItem(*i, ground);
if ((*i)->getUnit())
if ((*i)->getSlot() == ground)
{
_craftInventoryTile->setUnit((*i)->getUnit());
(*i)->getUnit()->setPosition(_craftInventoryTile->getPosition());
_craftInventoryTile->addItem(*i, ground);
if ((*i)->getUnit())
{
_craftInventoryTile->setUnit((*i)->getUnit());
(*i)->getUnit()->setPosition(_craftInventoryTile->getPosition());
}
}
}

Expand Down

0 comments on commit 5e97b19

Please sign in to comment.