void mission::assign( player &u ) { if( player_id == u.getID() ) { debugmsg( "strange: player is already assigned to mission %d", uid ); return; } if( player_id != -1 ) { debugmsg( "tried to assign mission %d to player, but mission is already assigned to %d", uid, player_id ); return; } player_id = u.getID(); u.on_mission_assignment( *this ); if( status == mission_status::yet_to_start ) { type->start( this ); status = mission_status::in_progress; } }
void mission::assign( player &u ) { if( player_id == u.getID() ) { debugmsg( "strange: player is already assigned to mission %d", uid ); return; } if( player_id != -1 ) { debugmsg( "tried to assign mission %d to player, but mission is already assigned to %d", uid, player_id ); return; } player_id = u.getID(); u.on_mission_assignment( *this ); if( status == mission_status::yet_to_start ) { if( type->goal == MGOAL_KILL_MONSTER_TYPE && monster_type != mtype_id::NULL_ID() ) { kill_count_to_reach = g->kill_count( monster_type ) + monster_kill_goal; } else if( type->goal == MGOAL_KILL_MONSTER_SPEC ) { kill_count_to_reach = g->kill_count( monster_species ) + monster_kill_goal; } type->start( this ); status = mission_status::in_progress; } }