Skip to content

Commit

Permalink
don't consider crafting material pickups server-side usable if the pl…
Browse files Browse the repository at this point in the history
…ayer doesn't have a material there
  • Loading branch information
BenLubar committed May 9, 2024
1 parent 6406829 commit 56e3082
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/game/shared/swarm/rd_crafting_defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,15 @@ bool CRD_Crafting_Material_Pickup::GetUseAction( ASWUseAction &action, C_ASW_Inh

bool CRD_Crafting_Material_Pickup::IsUsable( CBaseEntity *pUser )
{
#ifdef CLIENT_DLL
if ( m_iLastMaterialType == RD_CRAFTING_MATERIAL_NONE )
return false;
#endif
if ( pUser && pUser->IsInhabitableNPC() )
{
CASW_Player *pPlayer = assert_cast< CASW_Inhabitable_NPC * >( pUser )->GetCommander();
if ( !pPlayer || m_MaterialAtLocation[pPlayer->entindex() - 1] == RD_CRAFTING_MATERIAL_NONE )
{
return false;
}
}

return ( pUser && pUser->GetAbsOrigin().DistTo( GetAbsOrigin() ) < ASW_MARINE_USE_RADIUS ); // near enough?
}
#endif
Expand Down

0 comments on commit 56e3082

Please sign in to comment.