Jump to content

4 inventory bug (?)


Recommended Posts

  • Honorable Member

Could you explain it?
Because -> link (Slow internet 32kbps T_T)

 

 

I know this bug, and I fixxed this 4 month ago :D

Prewritten txt with pictures: ds fix.7z

 

But the problem is the SItemPos struct in common/length.h.

Here is the fixxed:

typedef struct SItemPos
{
	BYTE window_type;
	WORD cell;
	SItemPos ()
	{
		window_type = INVENTORY;
		cell = WORD_MAX;
	}
	SItemPos (BYTE _window_type, WORD _cell)
	{
		window_type = _window_type;
		cell = _cell;
	}
	bool IsValidItemPosition() const
	{
		switch (window_type)
		{
		case RESERVED_WINDOW:
			return false;
		case INVENTORY:
		case EQUIPMENT:
		case BELT_INVENTORY:
			return cell < INVENTORY_AND_EQUIP_SLOT_MAX;
		case DRAGON_SOUL_INVENTORY:
			return cell < (DRAGON_SOUL_INVENTORY_MAX_NUM);
		// µżŔűŔ¸·Î Ĺ©±â°ˇ Á¤ÇŘÁö´Â window´Â valid ĂĽĹ©¸¦ ÇŇ Ľö°ˇ ľř´Ů.
		case SAFEBOX:
		case MALL:
			return false;
		default:
			return false;
		}
		return false;
	}
	bool IsEquipPosition() const
	{
		return (IsDefaultInventoryEquipPosition() || IsDragonSoulEquipPosition());
	}
	bool IsDefaultInventoryEquipPosition() const
	{
		return ((INVENTORY == window_type || EQUIPMENT == window_type) && cell >= INVENTORY_MAX_NUM && cell < INVENTORY_MAX_NUM + WEAR_MAX_NUM);
	}
	bool IsDragonSoulEquipPosition() const
	{
		return ((INVENTORY == window_type || EQUIPMENT == window_type) && cell >= DRAGON_SOUL_EQUIP_SLOT_START && cell < DRAGON_SOUL_EQUIP_SLOT_END);
	}
	bool IsBeltInventoryPosition() const
	{
		return ((INVENTORY == window_type) && cell >= BELT_INVENTORY_SLOT_START && cell < BELT_INVENTORY_SLOT_END);
	}
	bool IsDefaultInventoryPosition() const
	{
		return ((INVENTORY == window_type) && cell < INVENTORY_MAX_NUM);
	}
	bool operator==(const struct SItemPos& rhs) const
	{
		return (window_type == rhs.window_type) && (cell == rhs.cell);
	}
	bool operator<(const struct SItemPos& rhs) const
	{
		return (window_type < rhs.window_type) || ((window_type == rhs.window_type) && (cell < rhs.cell));
	}
} TItemPos;

Me works ;)

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

  • 8 years later...

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.