Jump to content

QC error message for special characters next to apostrophes


Recommended Posts

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
  • Love 8
  • Good 4

AxgtRfG.png
C++ programmer at Gameloft

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • 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.