Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×
  • 0

Need help with a small function


Kafa

Question

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

  • Answers 0
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Activity

    1. 2

      Where are those maps/dungeons coming from?

    2. 3

      Press F10 to close the client immediately

    3. 2

      Where are those maps/dungeons coming from?

    4. 2

      Where are those maps/dungeons coming from?

    5. 4

      Visual studio 2022 compiling issue

    6. 1

      Count players function

    7. 64
    8. 1

      Costume shining/costume effect system

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.