Jump to content

How To Fix Blend Bug


ds_aim

Recommended Posts

Hi.

Search char_item.cpp ITEM_BLEND :

replace with this.

 

		case ITEM_BLEND:
			sys_log(0,"ITEM_BLEND!!");
			
			if (Blend_Item_find(item->GetVnum())) {
				int affect_type = AFFECT_BLEND;
				if (item->GetSocket(1) >= _countof(aApplyInfo)) {
					sys_err ("INVALID BLEND ITEM(id : %d, vnum : %d). APPLY TYPE IS %d.", item->GetID(), item->GetVnum(), item->GetSocket(0));
					return false;
				}
				int apply_type = aApplyInfo[item->GetSocket(1)].bPointType;
				int apply_value = item->GetSocket(2);
				int apply_duration = item->GetSocket(3);

				if (FindAffect(affect_type, apply_type)) {
					ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이미 효과가 걸려 있습니다."));
				} else {
						item->ModifyPoints(false); //Bug fix ds_aim
						AddAffect(affect_type, apply_type, apply_value, 0, apply_duration, 0, false);
						item->SetCount(item->GetCount() - 1);
				}
			}
			break;

PS: fix don't tested.
One friend said me to fix.

I don't really understand the bug, but test for me. 

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

		case ITEM_BLEND:
			sys_log(0, "ITEM_BLEND");

			if (Blend_Item_find(item->GetVnum()))
			{
				if (item->GetSocket(0) >= static_cast<long>(_countof(aApplyInfo))) // Use long for ignore warnings in gcc
				{
					sys_err("INVALID_BLEND_ITEM (id: %u, vnum: %u). Apply type is %ld", item->GetID(), item->GetVnum(), item->GetSocket(0));
					return false;
				}

				int iApplyType = aApplyInfo[item->GetSocket(0)].bPointType;
				int iApplyValue = item->GetSocket(1), iApplyDuration = item->GetSocket(2);

				if (FindAffect(AFFECT_BLEND, iApplyType))
				{
					ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ¹Ì È¿°ú°¡ °É·Á ÀÖ½À´Ï´Ù."));
					return false;
				}

				item->ModifyPoints(false);
				item->SetCount(item->GetCount() - 1);
				AddAffect(AFFECT_BLEND, iApplyType, iApplyValue, 0, iApplyDuration, 0, false);
			}
			break;

Description:

The system will remove old values on your character and add the new one on your character. I changed the code style. (I just don't like bad code style. :wub:)

Kind Regards ~ Ken

  • Metin2 Dev 1
  • Love 2

Do not be sorry, be better.

Link to comment
Share on other sites

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.