Jump to content

Metin2 - Ignore Lower Buffs


Recommended Posts

  • Forum Moderator

M2 Download Center

This is the hidden content, please
( Internal )

 

Download:

This is the hidden content, please

  • Metin2 Dev 86
  • Dislove 2
  • Angry 1
  • Smile Tear 1
  • Think 3
  • Confused 1
  • Good 17
  • Love 1
  • Love 102
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 years later...

A "2020 style" if someone need

 

	auto ignore = std::array<DWORD, 6>{SKILL_HOSIN, SKILL_REFLECT, SKILL_GICHEON, SKILL_JEONGEOP, SKILL_KWAESOK, SKILL_JEUNGRYEOK};
	if (std::find(std::begin(ignore), std::end(ignore), dwType) != std::end(ignore))
	{
		auto pkAffect = FindAffect(dwType);
		if (pkAffect)
		{
			if (lApplyValue < pkAffect->lApplyValue)
			{
				ChatPacket(CHAT_TYPE_INFO, "<AddAffect> has blocked receiving skill (%s) because power is (%ld%%) more small than current one (%ld%%).", CSkillManager::instance().Get(dwType)->szName, lApplyValue, pkAffect->lApplyValue);
				return false;
			}
		}	
	}

 

Link to comment
Share on other sites

  • Forum Moderator
51 minutes ago, ManiacRobert said:

A "2020 style" if someone need




	auto ignore = std::array<DWORD, 6>{SKILL_HOSIN, SKILL_REFLECT, SKILL_GICHEON, SKILL_JEONGEOP, SKILL_KWAESOK, SKILL_JEUNGRYEOK};
	if (std::find(std::begin(ignore), std::end(ignore), dwType) != std::end(ignore))

 

 

I would understand if you really posted a "2020 style" after 3 years (released in 2017) ... but you did it worst than actually is, if you think a std::array and std::find it's better than a switch for 6 values which are static, that's really wrong.

Also you're redeclaring the std::aray variable each time when the function it's called, that's not 2020 anymore.

 

Basically if you really want something called "2020", this is:

static const std::set<std::uint8_t> ignoreSkillSet = {SKILL_HOSIN, SKILL_REFLECT, SKILL_GICHEON, SKILL_JEONGEOP, SKILL_KWAESOK, SKILL_JEUNGRYEOK};
if (ignoreSkillSet.contains(dwType))
{
	const auto& affect = FindAffect(dwType);
	if (affect && affect->lApplyValue > lApplyValue)
		return false;
}

 

But still, switch is better than everything what you could do with your "2020 style", in this case.

switch (dwType)
{
	case SKILL_HOSIN:
	case SKILL_REFLECT:
	case SKILL_GICHEON:
	case SKILL_JEONGEOP:
	case SKILL_KWAESOK:
	case SKILL_JEUNGRYEOK:
	{
		[...]
	}
	break;
}

 

But it's fine, seems you're that type of guy who's using "auto" on everything and think that's cool and 2020 style, typical for metin2 "developers".

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

  • Forum Moderator

I didn't took it personal, I explained everything nicely.

The thing with "typical metin2 developers", was general, not for you and it's because in the last period I saw a bunch of people who said they rewrote things and in reality they just added "auto" on everything and that's all, 2020 style.. but c++11 it's available since 9 years.

But seems you got it wrong.

Edited by VegaS™
  • Love 1
Link to comment
Share on other sites

Announcements



  • Similar Content

  • Similar Content

  • Similar Content

  • Tags

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