From c915e73c23d4b26f9ff81b75960bddfb3e9b84e3 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sun, 15 Dec 2024 15:17:47 -0600 Subject: [PATCH] move assert below range check --- src/game/shared/swarm/rd_inventory_shared.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/shared/swarm/rd_inventory_shared.cpp b/src/game/shared/swarm/rd_inventory_shared.cpp index a9154d6ea..64ef3e863 100644 --- a/src/game/shared/swarm/rd_inventory_shared.cpp +++ b/src/game/shared/swarm/rd_inventory_shared.cpp @@ -2221,12 +2221,12 @@ static class CRD_Inventory_Manager final : public CAutoGameSystem, public CGameE } Assert( eMaterial > RD_CRAFTING_MATERIAL_NONE && eMaterial < NUM_RD_CRAFTING_MATERIAL_TYPES ); - Assert( g_RD_Crafting_Material_Rarity_Info[g_RD_Crafting_Material_Info[eMaterial].m_iRarity].m_bCanFindInMission ); if ( eMaterial <= 0 || eMaterial >= NUM_RD_CRAFTING_MATERIAL_TYPES ) { Warning( "Cannot pick up crafting material at location %d with out of range type %d!\n", iLocation, eMaterial ); return; } + Assert( g_RD_Crafting_Material_Rarity_Info[g_RD_Crafting_Material_Info[eMaterial].m_iRarity].m_bCanFindInMission ); if ( m_CraftingMaterialType[iLocation] == RD_CRAFTING_MATERIAL_NONE || m_CraftingMaterialToken[iLocation] == k_SteamItemInstanceIDInvalid ) { @@ -2266,13 +2266,13 @@ static class CRD_Inventory_Manager final : public CAutoGameSystem, public CGameE GET_INVENTORY_OR_BAIL; Assert( eMaterial > RD_CRAFTING_MATERIAL_NONE && eMaterial < NUM_RD_CRAFTING_MATERIAL_TYPES ); - Assert( g_RD_Crafting_Material_Rarity_Info[g_RD_Crafting_Material_Info[eMaterial].m_iRarity].m_bCanFindInMission ); - Assert( g_RD_Crafting_Material_Rarity_Info[g_RD_Crafting_Material_Info[eMaterial].m_iRarity].m_bAllowPickupAssist ); if ( eMaterial <= 0 || eMaterial >= NUM_RD_CRAFTING_MATERIAL_TYPES ) { Warning( "Cannot pick up crafting material for assist with out of range type %d!\n", eMaterial ); return; } + Assert( g_RD_Crafting_Material_Rarity_Info[g_RD_Crafting_Material_Info[eMaterial].m_iRarity].m_bCanFindInMission ); + Assert( g_RD_Crafting_Material_Rarity_Info[g_RD_Crafting_Material_Info[eMaterial].m_iRarity].m_bAllowPickupAssist ); CUtlVector optin; ReactiveDropInventory::GetItemsForSlot( optin, "crafting_material_beta_opt_in" );