| 66 | } |
| 67 | |
| 68 | void BuildingExt::StoreTiberium(BuildingClass* pThis, float amount, int idxTiberiumType, int idxStorageTiberiumType) |
| 69 | { |
| 70 | auto const pDepositableTiberium = TiberiumClass::Array.GetItem(idxStorageTiberiumType); |
| 71 | float depositableTiberiumAmount = 0.0f; // Number of 'bails' that will be stored. |
| 72 | auto const pTiberium = TiberiumClass::Array.GetItem(idxTiberiumType); |
| 73 | |
| 74 | if (amount > 0.0) |
| 75 | { |
| 76 | if (auto pBuildingType = pThis->Type) |
| 77 | { |
| 78 | if (auto const pExt = BuildingTypeExt::ExtMap.Find(pBuildingType)) |
| 79 | { |
| 80 | if (pExt->Refinery_UseStorage) |
| 81 | { |
| 82 | // Store Tiberium in structures |
| 83 | depositableTiberiumAmount = (amount * pTiberium->Value) / pDepositableTiberium->Value; |
| 84 | pThis->Owner->GiveTiberium(depositableTiberiumAmount, idxStorageTiberiumType); |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | void BuildingExt::ExtData::UpdatePrimaryFactoryAI() |
| 92 | { |