Jump to content

War flag fix


caanmasu

Recommended Posts

Hi

 

Bug fix by me

 

Before fix: https://metin2.download/video/FHN62NXpd74c1pLqPt5PJDX7IBs5r2vA/.mp4

After fix: https://metin2.download/video/NguTHfen88bFnAuP6JZ5fIMiiLoeSgRm/.mp4

 

Fix:

 

char_state.cpp


Comment this line:
 

f.m_pkChrFind->AddAffect(AFFECT_WAR_FLAG, POINT_MOV_SPEED, 50 - f.m_pkChrFind->GetPoint(POINT_MOV_SPEED), 0, INFINITE_AFFECT_DURATION, 0, false);

Add below:

f.m_pkChrFind->UpdatePacket();

 

Like this:

	if (!pMap->GetTeamIndex(GetPoint(POINT_STAT), idx))
		return;

	f.m_pkChrFind->AddAffect(AFFECT_WAR_FLAG, POINT_NONE, GetPoint(POINT_STAT), idx == 0 ? AFF_WAR_FLAG1 : AFF_WAR_FLAG2, INFINITE_AFFECT_DURATION, 0, false);
	//f.m_pkChrFind->AddAffect(AFFECT_WAR_FLAG, POINT_MOV_SPEED, 50 - f.m_pkChrFind->GetPoint(POINT_MOV_SPEED), 0, INFINITE_AFFECT_DURATION, 0, false); //fix
	f.m_pkChrFind->UpdatePacket();  //fix

	pMap->RemoveFlag(idx);

 

char.cpp

Find:

		case POINT_MOV_SPEED:
			min_limit = 0;

			if (IsPC())
				limit = 200;
			else
				limit = 250;

Add below:

			if (FindAffect(AFFECT_WAR_FLAG))
				limit = 50;

 

Like this:

		case POINT_MOV_SPEED:
			min_limit = 0;

			if (IsPC())
				limit = 200;
			else
				limit = 250;
			if (FindAffect(AFFECT_WAR_FLAG))
				limit = 50;
			break;

 

 

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Metin2 Dev 3
  • Good 1
  • Love 5
Link to comment
Share on other sites

  • 1 month later...

Your approach is wrong...

I've fixed it by changing case POINT_MOV_SPEED from ::PointChange like:

		case POINT_MOV_SPEED:
			if (FindAffect(AFFECT_WAR_FLAG))
				SetPoint(type, FindAffect(AFFECT_WAR_FLAG)->lApplyValue);
			else
				SetPoint(type, GetPoint(type) + amount);
			val = GetPoint(type);
			break;

Ofc there should exist a better way, but i'll stick with that.

Don't forget to change 50 - f.m_pkChrFind->GetPoint(POINT_MOV_SPEED) part as if your movment speed is greater than 50 will become negative, for me a fixed value works the best, you can use std::min or smth but i guess all players should have the same speed with the flag.

Link to comment
Share on other sites



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