Skip to content

Commit 61c3eca

Browse files
committed
set fuse timer to match template
1 parent 380afda commit 61c3eca

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/Battlescape/InventoryState.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,11 @@ void InventoryState::btnApplyTemplateClick(Action *action)
615615
return;
616616
}
617617

618-
BattleUnit *unit = _battleGame->getSelectedUnit();
619-
std::vector<BattleItem*> *unitInv = unit->getInventory();
620-
Tile *groundTile = unit->getTile();
621-
std::vector<BattleItem*> *groundInv = groundTile->getInventory();
618+
BattleUnit *unit = _battleGame->getSelectedUnit();
619+
std::vector<BattleItem*> *unitInv = unit->getInventory();
620+
Tile *groundTile = unit->getTile();
621+
std::vector<BattleItem*> *groundInv = groundTile->getInventory();
622+
RuleInventory *groundRuleInv = _game->getRuleset()->getInventory("STR_GROUND");
622623

623624
_clearInventory(_game, unitInv, groundTile);
624625

@@ -672,6 +673,7 @@ void InventoryState::btnApplyTemplateClick(Action *action)
672673
(*groundItem)->setSlot(_game->getRuleset()->getInventory((*templateIt)->getSlot()));
673674
(*groundItem)->setSlotX((*templateIt)->getSlotX());
674675
(*groundItem)->setSlotY((*templateIt)->getSlotY());
676+
(*groundItem)->setFuseTimer((*templateIt)->getFuseTimer());
675677
unitInv->push_back(*groundItem);
676678
groundInv->erase(groundItem);
677679
found = true;
@@ -683,8 +685,6 @@ void InventoryState::btnApplyTemplateClick(Action *action)
683685
// the right weapon, unload the target weapon, load the right ammo, and use it
684686
if (!found && matchedWeapon && (!needsAmmo || matchedAmmo))
685687
{
686-
RuleInventory *groundRuleInv = _game->getRuleset()->getInventory("STR_GROUND");
687-
688688
// unload the existing ammo (if any) from the weapon
689689
BattleItem *loadedAmmo = matchedWeapon->getAmmoItem();
690690
if (loadedAmmo)

0 commit comments

Comments
 (0)