From ef3a7e44346b93bcfd328c2826cb5925a6553e7f Mon Sep 17 00:00:00 2001 From: Buscher Date: Tue, 29 Jul 2025 09:33:17 +0200 Subject: [PATCH 1/3] ASD/ARC: Fix Error by One in gasCan Vector --- Strategic/Rebel Command.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Strategic/Rebel Command.cpp b/Strategic/Rebel Command.cpp index 2f8a05c26b..1863bfc831 100644 --- a/Strategic/Rebel Command.cpp +++ b/Strategic/Rebel Command.cpp @@ -4773,7 +4773,7 @@ void ApplyAdditionalASDEffects() case MissionHelpers::DISRUPT_ASD_STEAL_FUEL: { // spawn a gas can - CreateItemAtAirport(ItemIdCache::gasCans.at(ItemIdCache::gasCans.size()), 75 + Random(26)); + CreateItemAtAirport(ItemIdCache::gasCans.at(ItemIdCache::gasCans.size() - 1), 75 + Random(26)); // say it came from the ASD's reserves AddStrategicAIResources(ASD_FUEL, -(gGameExternalOptions.gASDResource_Fuel_Jeep + Random(gGameExternalOptions.gASDResource_Fuel_Jeep))); From 4f9efbc292915ca2b216c710ec4a890458fb6654 Mon Sep 17 00:00:00 2001 From: Buscher Date: Fri, 15 Aug 2025 17:29:31 +0200 Subject: [PATCH 2/3] Add size check for the gasCan vector as part of ARC --- Strategic/Rebel Command.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Strategic/Rebel Command.cpp b/Strategic/Rebel Command.cpp index 1863bfc831..cf484ea17b 100644 --- a/Strategic/Rebel Command.cpp +++ b/Strategic/Rebel Command.cpp @@ -4772,8 +4772,10 @@ void ApplyAdditionalASDEffects() { case MissionHelpers::DISRUPT_ASD_STEAL_FUEL: { - // spawn a gas can - CreateItemAtAirport(ItemIdCache::gasCans.at(ItemIdCache::gasCans.size() - 1), 75 + Random(26)); + // only spawn a gas can if at least one gas can is known by the game (ItemIsGascan) + if (ItemIdCache::gasCans.size() > 0) + // The gas can is spawned like a Bobby Ray delivery (you need to open the crate) + CreateItemAtAirport(ItemIdCache::gasCans.at(ItemIdCache::gasCans.size() -1), 75 + Random(26)); // say it came from the ASD's reserves AddStrategicAIResources(ASD_FUEL, -(gGameExternalOptions.gASDResource_Fuel_Jeep + Random(gGameExternalOptions.gASDResource_Fuel_Jeep))); From 63035091d9011e7702e6cdfea3db789aefaf18f1 Mon Sep 17 00:00:00 2001 From: Buscher Date: Fri, 15 Aug 2025 19:00:11 +0200 Subject: [PATCH 3/3] Remove unused Vectors for ARC --- Strategic/Rebel Command.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/Strategic/Rebel Command.cpp b/Strategic/Rebel Command.cpp index cf484ea17b..7c1696571b 100644 --- a/Strategic/Rebel Command.cpp +++ b/Strategic/Rebel Command.cpp @@ -129,21 +129,10 @@ namespace ItemIdCache { // cache these values on load so that we don't need to search for them every time something happens std::vector gasCans; - std::vector firstAidKits; - std::vector medKits; - std::vector toolKits; - std::vector ammo[10]; // coolness void Clear() { gasCans.clear(); - firstAidKits.clear(); - medKits.clear(); - toolKits.clear(); - for (int i = 0; i < 10; ++i) - { - ammo[i].clear(); - } } } @@ -4418,23 +4407,6 @@ void SetupInfo() for (UINT16 i = 0; i < MAXITEMS; ++i) { if (ItemIsGascan(i)) ItemIdCache::gasCans.push_back(i); - else if (ItemIsFirstAidKit(i)) ItemIdCache::firstAidKits.push_back(i); - else if (ItemIsMedicalKit(i)) ItemIdCache::medKits.push_back(i); - else if (ItemIsToolkit(i)) ItemIdCache::toolKits.push_back(i); - else if (Item[i].usItemClass & IC_AMMO) - { - if (Magazine[Item[i].ubClassIndex].ubMagType == AMMO_BOX) - { - if ((gGameOptions.fGunNut || !ItemIsOnlyInTonsOfGuns(i)) - && (gGameOptions.ubGameStyle == STYLE_SCIFI || !ItemIsOnlyInScifi(i))) - { - // coolness runs from 1-10, so apply offset - const UINT8 coolness = min(max(1, Item[i].ubCoolness), 10); - ItemIdCache::ammo[coolness-1].push_back(i); - } - } - } - } }