Jump to content

QC error message for special characters next to apostrophes


Recommended Posts

  • Honorable Member

Hey guys,

Most of you noticed if you have a special character like á, é, ő, etc. at the beginning or end of a string qc will not work and displays no error message. It is because it throws an error but in it's own way by pushing a string to the top of the lua stack and calling exit so you can't catch it normally. Here is a method how you can make these messages visible.

 

0721381.png

 

0722251b.png

 

Actually we only have to write a few lines.

 

Open qc.cc and add this function

void print_exception()
{
	int top = lua_gettop(L);
	if (0 != top && LUA_TSTRING == lua_type(L, top))
	{
		std::cerr << lua_tostring(L, top);
	}
}

 

Now go to the main function and add this line to the beginning of it:

atexit(&print_exception);

 

So it should look like this:

 

0721382.png

 

Now you will see the exceptions like

 

0721383.png

 

Good luck guys and hope you like it!  ❤️

  • Metin2 Dev 1
  • Good 4
  • Love 1
  • Love 8

WRnRW3H.gif

Link to comment
Share on other sites

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.