Jump to content

Recommended Posts

  • Active Member

How to fix 

Cube_request_result_list: Too long cube result list text. ?

 

Go in cube.cpp

Replace 

Spoiler

        if (resultText.size() - 20 >= CHAT_MAX_LEN)
        {
            sys_err("[CubeInfo] Too long cube result list text. (NPC: %d, length: %d)", npcVNUM, resultText.size());
            resultText.clear();
            resultCount = 0;
        }

 

With this:

Spoiler

        int WildFantasytFIXED;
        if (resultText.size() < 20)
        {
            WildFantasytFIXED = 20 - resultText.size();
        }
        else
        {
            WildFantasytFIXED = resultText.size() - 20;
        }
        if (WildFantasytFIXED >= CHAT_MAX_LEN)
        {
            sys_err("[CubeInfo] Too long cube result list text. (NPC: %d, FIXED_size_value_exygo: %d, length: %d)", npcVNUM, WildFantasytFIXED, resultText.size());
            resultText.clear();
            resultCount = 0;
        }

The problem was caused by a comparison between a negative number and a number

  • Love 1
Link to comment
https://metin2.dev/topic/9704-fix-too-long-cube-result-list-text/
Share on other sites

size_t resultTextSize = resultText.size() < 20 ? 20 - resultText.size() : resultText.size() - 20;

if (resultTextSize >= CHAT_MAX_LEN)
{
	sys_err("[CubeInfo] Too long cube result list text. (NPC: %d, length: %d)", npcVNUM, resultText.size());
	resultText.clear();
	resultCount = 0;
}

 It's more effectively and short. Thank you for share this fix with us.

Kind Regards ~ Ken

  • Metin2 Dev 1
  • Love 2

Do not be sorry, be better.

  • 2 months later...
  • Active Member
On 12/17/2015 at 8:19 PM, Ken said:

size_t resultTextSize = resultText.size() < 20 ? 20 - resultText.size() : resultText.size() - 20;

if (resultTextSize >= CHAT_MAX_LEN)
{
	sys_err("[CubeInfo] Too long cube result list text. (NPC: %d, length: %d)", npcVNUM, resultText.size());
	resultText.clear();
	resultCount = 0;
}

 It's more effectively and short. Thank you for share this fix with us.

Kind Regards ~ Ken

I was noob at that time and didn't know about that conversion ...

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.