Skip to content

Commit

Permalink
Don't save "technical" items in the inv. templates
Browse files Browse the repository at this point in the history
  • Loading branch information
MeridianOXC committed Jun 25, 2023
1 parent 26aaf9d commit fe8f927
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Battlescape/InventoryState.cpp
Expand Up @@ -716,6 +716,11 @@ void InventoryState::saveEquipmentLayout()
bool loaded = bi->needsAmmoForSlot(0) && bi->getAmmoForSlot(0);
if (!loaded) continue;
}
else if (!bi->getRules()->canBeEquippedToCraftInventory())
{
// skip other not-allowed items, which somehow made it here (e.g. were spawned instead of equipped)
continue;
}

layoutItems->push_back(new EquipmentLayoutItem(bi));
}
Expand Down Expand Up @@ -1229,6 +1234,11 @@ void InventoryState::_createInventoryTemplate(std::vector<EquipmentLayoutItem*>
bool loaded = bi->needsAmmoForSlot(0) && bi->getAmmoForSlot(0);
if (!loaded) continue;
}
else if (!bi->getRules()->canBeEquippedToCraftInventory())
{
// skip other not-allowed items, which somehow made it here (e.g. were spawned instead of equipped)
continue;
}

inventoryTemplate.push_back(new EquipmentLayoutItem(bi));
}
Expand Down

0 comments on commit fe8f927

Please sign in to comment.