Skip to content

Commit

Permalink
move assert below range check
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLubar committed Dec 15, 2024
1 parent 74df27d commit c915e73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/game/shared/swarm/rd_inventory_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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<ReactiveDropInventory::ItemInstance_t> optin;
ReactiveDropInventory::GetItemsForSlot( optin, "crafting_material_beta_opt_in" );
Expand Down

0 comments on commit c915e73

Please sign in to comment.