Skip to content
Permalink
Browse files

Merge pull request #1217 from MeridianOXC/one-more

Correctly drop units on the ground
  • Loading branch information
Warboy1982 committed Feb 4, 2019
2 parents 59f9f0e + 386e945 commit c61f43a90206b6bd80758accd0c63c4063a98954
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/Battlescape/BattlescapeGenerator.cpp
@@ -192,6 +192,8 @@ void BattlescapeGenerator::setMissionSite(MissionSite *mission)
*/
void BattlescapeGenerator::nextStage()
{
RuleInventory *ground = _game->getMod()->getInventory("STR_GROUND", true);

// preventively drop all units from soldier's inventory (makes handling easier)
// 1. no alien/civilian living, dead or unconscious is allowed to transition
// 2. no dead xcom unit is allowed to transition
@@ -211,7 +213,11 @@ void BattlescapeGenerator::nextStage()
for (std::vector<BattleItem*>::iterator corpseItem = unitsToDrop.begin(); corpseItem != unitsToDrop.end(); ++corpseItem)
{
(*corpseItem)->moveToOwner(0);
(*unit)->getTile()->addItem(*corpseItem, (*corpseItem)->getSlot());
(*unit)->getTile()->addItem(*corpseItem, ground);
if ((*corpseItem)->getUnit() && (*corpseItem)->getUnit()->getStatus() == STATUS_UNCONSCIOUS)
{
(*corpseItem)->getUnit()->setPosition((*unit)->getTile()->getPosition());
}
}
}
}
@@ -475,7 +481,6 @@ void BattlescapeGenerator::nextStage()
{
_save->selectNextPlayerUnit();
}
RuleInventory *ground = _game->getMod()->getInventory("STR_GROUND", true);

for (std::vector<BattleItem*>::iterator i = takeToNextStage.begin(); i != takeToNextStage.end(); ++i)
{

0 comments on commit c61f43a

Please sign in to comment.