Jump to content

Channel crashes when trading coins!


Recommended Posts

Hello!

 
I have a problem took off her gold limit works well but as Form 1 trades with the figure 2 ( figure 1 has 99,999,999,999,999 gold | figure 2 is 0 gold ) and how I want to translate 1 gold from Form 1 to Form 2 trade I press accept and canal off .
syser Channel 1
SYSERR: Jan 13 11:23:30 :: locale_find: LOCALE_ERROR: "The player with whom you are trading has too much yang!";
syslogp
Jan 13 11:23:30 :: CInputMain()::Exchange()  SubHeader 3 
SYSERR: Jan 13 11:23:30 :: locale_find: LOCALE_ERROR: "The player with whom you are trading has too much yang!";
a player who wants to give 1 gold has 0 yang

if a player has 5 yang and yang gives 1 player who is 0 yang does not exclude channels

Help Pleas !

 

Edited by Pitos
Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

@metin2team

bool CExchange::AddGold(unsigned long long gold)
{
    if (gold <= 0)
        return false;
    if (GetOwner()->GetGold() < gold)
    {
        // 가지고 있는 돈이 부족.
        exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_GOLD, 0, 0, NPOS, 0);
        return false;
    }
    if ( LC_IsCanada() == true || LC_IsEurope() == true )
    {
        if ( m_lGold > 0 )
        {
            return false;
        }
    }
    if (GOLD_MAX_EXCHANGE <= gold)
    {
        GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nie mozesz przekazac tyle yang na handlu!"));
        return false;
    }
    Accept(false);
    GetCompany()->Accept(false);
    m_lGold = gold;
    exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, true, m_lGold, NPOS, 0);
    exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, false, m_lGold, NPOS, 0);
    return true;

refresh ! Help please :(

Link to comment
Share on other sites

  • 1 year later...

Replace with

 

	bool CExchange::AddGold(unsigned long long gold)
{
    if (gold <= 0)
        return false;
	    if (GetOwner()->GetGold() < gold)
    {
        // 가지고 있는 돈이 부족.
        exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_GOLD, 0, 0, NPOS, 0);
        return false;
    }
	    if ( LC_IsCanada() == true || LC_IsEurope() == true )
    {
        if ( m_lGold > 0 )
        {
            return false;
        }
    }
	    Accept(false);
    GetCompany()->Accept(false);
	    m_lGold = gold;
	    exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, true, m_lGold, NPOS, 0);
    exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, false, m_lGold, NPOS, 0);
    return true;
}
	 
	

Link to comment
Share on other sites

  • Premium
9 hours ago, Zorke said:

Replace with

 

 


	bool CExchange::AddGold(unsigned long long gold)
{
    if (gold <= 0)
        return false;
	    if (GetOwner()->GetGold() < gold)
    {
        // 가지고 있는 돈이 부족.
        exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_GOLD, 0, 0, NPOS, 0);
        return false;
    }
	    if ( LC_IsCanada() == true || LC_IsEurope() == true )
    {
        if ( m_lGold > 0 )
        {
            return false;
        }
    }
	    Accept(false);
    GetCompany()->Accept(false);
	    m_lGold = gold;
	    exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, true, m_lGold, NPOS, 0);
    exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, false, m_lGold, NPOS, 0);
    return true;
}
	 
	

 

I dont think removing that check is a optimal way to solve the problem, insteal just go and modify this for your use

GOLD_MAX_EXCHANGE

 

P.s. I dont understand why you should have that stupid amount of gold, the more you got, the less it will be worth.
Just implement won or that kind of stuff instead of having 8238948423954238925482549824598459485945895345409540294039 yang in your inventory, its common sense guys

Btw if you using an unsigned long long int the param that gets that quantity has to be the same or more capable, you cant leave it as normal int

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.