Jump to content

New Config Option


Go to solution Solved by Ken,

Recommended Posts

Hey all,

 

I wanted to make a CONFIG option for the count of member in a party.

// config.cpp

char max_party_member = 8;

TOKEN ("max_party_member")
{
	str_to_number(max_party_member, value_string);
	
	max_party_member = MINMAX(2, max_party_member, 20);
	
	fprintf(stderr, "MAX_PARTY_MEMBER_COUNT: %dn", max_party_member);
	
}

// config.h

extern char max_party_member;

// party.h

PARTY_MAX_MEMBER = max_party_member,

thats what i did but in party.h there has to be a constant value so i cant change the value of it. Does anyone know the solution of it?

Link to comment
Share on other sites

  • Solution

You can't do this. You must be define a variable for that.

 

Like this ;

 

config.h

extern int g_iMaxPartyMember;

config.cpp

int g_iMaxPartyMember = 8; // Max Party Member is 8 (Default)

TOKEN("max_party_member")
{
	str_to_number(g_iMaxPartyMember,value_string);
	sys_log(0,"Party Max Member changed with %d",g_iMaxPartyMember);
	continue;
}

And search this in char.cpp

	else if (pchLeader->GetParty())
   	{
	   	if (pchLeader->GetParty()->GetMemberCount() == PARTY_MAX_MEMBER)
			return PERR_PARTYISFULL;
	}

replace with this

	else if (pchLeader->GetParty())
   	{
	   	if (pchLeader->GetParty()->GetMemberCount() == g_iMaxPartyMember)
			return PERR_PARTYISFULL;
	}

Best Regards

Ellie

  • Love 2

Do not be sorry, be better.

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



  • Similar Content

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.