void remove_item() override { if( &cur.veh.parts[ cur.part ].base == target() ) { cur.veh.remove_part( cur.part ); } else { cur.remove_item( *target() ); } }
void remove_item() override { item &base = cur.veh.parts[ cur.part ].base; if( &base == target() ) { cur.veh.remove_part( cur.part ); // vehicle_part::base } else { cur.remove_item( *target() ); // item within CARGO } }
bool valid() const override { if( !target() ) { return false; } if( &cur.veh.parts[ cur.part ].base == target() ) { return true; // vehicle_part::base } if( cur.has_item( *target() ) ) { return true; // item within CARGO } return false; }
bool valid() const override { return target() && cur.has_item( *target() ); }