Jump to content

Real fix for Offline Shop name crash with Alpha Characters


Retro

Recommended Posts

Heya, i was browsing the forum and i saw this topic:

Firstly i want to say that i din't this post to make a bad image to the people who written there, i saw that they complicated it very much, the fix is pretty easy so i'm gonna share with you.

Open char.cpp

Search for:

    if (g_bNeedMoney)
    {
        if (GetGold() < static_cast<int>(g_dwNeedMoney))
        {
            ChatPacket(CHAT_TYPE_INFO, "Your money is not enough for open offline shop. Required money : %u", g_dwNeedMoney);
            return;
        }
    }

After that function you will see that:

    
    char szSign[SHOP_SIGN_MAX_LEN+1];
    strlcpy(szSign, c_pszSign, sizeof(szSign));

    m_stOfflineShopSign = szSign;

    if (m_stOfflineShopSign.length() == 0)
        return;    
    
    if (CBanwordManager::instance().CheckString(m_stShopSign.c_str(), m_stShopSign.length()))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("비속어나 은어가 포함된 상점 이름으로 상점을 열 수 없습니다."));
        return;
    }

There's also a image: https://metin2.download/picture/dz8FBGD0F8oWYaUCoh8Zxi3wYO51TrA4/.png

So replace this:

    char szSign[SHOP_SIGN_MAX_LEN+1];
    strlcpy(szSign, c_pszSign, sizeof(szSign));

    m_stOfflineShopSign = szSign;

    if (m_stOfflineShopSign.length() == 0)
        return;    
    
    if (CBanwordManager::instance().CheckString(m_stShopSign.c_str(), m_stShopSign.length()))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("비속어나 은어가 포함된 상점 이름으로 상점을 열 수 없습니다."));
        return;
    }

With:

    if (!check_name(c_pszSign))
    {
        ChatPacket(CHAT_TYPE_INFO, "Pretty easy,huh?");
        ChatPacket(CHAT_TYPE_INFO, "If it works go to the topic title and give a thanks to the author.");       

        ChatPacket(CHAT_TYPE_INFO, "Just Kidding!");        
        return;
    }

    m_stOfflineShopSign = c_pszSign;
    
    if (CBanwordManager::instance().CheckString(m_stShopSign.c_str(), m_stShopSign.length()))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("비속어나 은어가 포함된 상점 이름으로 상점을 열 수 없습니다."));
        return;
    }

There's a image again to see how it should look likehttps://metin2.download/picture/K4uOqryS4tB6JS4Og68qXhNoe13DGGHZ/.png

 

Have a nice day!

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

  • 5 weeks later...
  • 3 weeks later...

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.