Jump to content

Need help with a small function


Recommended Posts

void locale_quest_init(const char* filename, BYTE lang)
{
	std::ifstream file(filename);
	if (file.is_open() == false)
	{
		sys_err("Cannot open %s file.", filename);
		return;
	}

	std::string   line;

	while (std::getline(file, line))
	{
		std::stringstream			linestream(line);
		int							vnum;
		std::string					text;

		std::getline(linestream, text, '\t');

		if (text.empty() || text.at(0) == '#')
			continue;

		linestream >> vnum;
		localequest[lang].insert(std::make_pair(vnum, text));
	}

	file.close();
}

 

Can someone help me, i do not understand what's wrong there 😞 

Goal was to read 

13305	Hey! Do you have the key to free me?
13306	Please set me free. Can't anybody help me?

These lines from locale_quest.txt

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.