Пример #1
0
std::vector<item> game::multidrop() {
    int dummy = 0;
    std::vector<item> dropped_worn;
    std::vector<item> result = multidrop(dropped_worn, dummy);
    result.insert(result.end(), dropped_worn.begin(), dropped_worn.end());
    return result;
}
bool game::make_drop_activity( enum activity_type act, point target )
{
    std::list<std::pair<int, int> > dropped = multidrop();
    if( dropped.empty() ) {
        return false;
    }
    u.assign_activity( act, 0 );
    u.activity.placement = point( target.x - u.posx(), target.y - u.posy() );
    for( auto item_pair : dropped ) {
        u.activity.values.push_back( item_pair.first );
        u.activity.values.push_back( item_pair.second );
    }
    return true;
}
bool game::make_drop_activity( enum activity_type act, const tripoint &target, bool to_vehicle )
{
    std::list<std::pair<int, int> > dropped = multidrop();
    if( dropped.empty() ) {
        return false;
    }
    u.assign_activity( act, 0 );
    u.activity.placement = target - u.pos();
    u.activity.values.push_back(to_vehicle);
    for( auto item_pair : dropped ) {
        u.activity.values.push_back( item_pair.first );
        u.activity.values.push_back( item_pair.second );
    }
    return true;
}