Jump to content

New belt inventory bug


Recommended Posts

 

/// new bug fix.
static bool IsExistItemInBeltInventory(LPCHARACTER pc)
{
for (WORD
 
Deponun Gamede Ne Diye Geçtiğine Bakıyorum Çözücem Gibi 
 

English ; UP 

Link to comment
Share on other sites

Make like that ;

 

bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)
{
	LPITEM item = NULL;

	if (!IsValidItemPosition(Cell))
		return false;

	if (!(item = GetItem(Cell)))
		return false;

	if (item->IsExchanging())
		return false;

	if (item->GetCount() < count)
		return false;
        
        if (item->IsEquipped())
                return false;

	if (INVENTORY == Cell.window_type && Cell.cell >= INVENTORY_MAX_NUM && IS_SET(item->GetFlag(), ITEM_FLAG_IRREMOVABLE))
		return false;

	if (true == item->isLocked())
		return false;

	if (!IsValidItemPosition(DestCell))
	{
		return false;
	}

	if (!CanHandleItem())
	{
		if (NULL != DragonSoul_RefineWindow_GetOpener())
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°­È­Ã¢À» ¿¬ »óÅ¿¡¼­´Â ¾ÆÀÌÅÛÀ» ¿Å±æ ¼ö ¾ø½À´Ï´Ù."));
		return false;
	}

	// ±âȹÀÚÀÇ ¿äûÀ¸·Î º§Æ® Àκ¥Å丮¿¡´Â ƯÁ¤ ŸÀÔÀÇ ¾ÆÀÌÅÛ¸¸ ³ÖÀ» ¼ö ÀÖ´Ù.
	if (DestCell.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(item))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ ¾ÆÀÌÅÛÀº º§Æ® Àκ¥Å丮·Î ¿Å±æ ¼ö ¾ø½À´Ï´Ù."));			
		return false;
	}

	// ÀÌ¹Ì Âø¿ëÁßÀÎ ¾ÆÀÌÅÛÀ» ´Ù¸¥ °÷À¸·Î ¿Å±â´Â °æ¿ì, 'ÀåÃ¥ ÇØÁ¦' °¡´ÉÇÑ Áö È®ÀÎÇÏ°í ¿Å±è
	if (Cell.IsEquipPosition() && !CanUnequipNow(item))
		return false;

	if (DestCell.IsEquipPosition())
	{
		if (GetItem(DestCell))	// ÀåºñÀÏ °æ¿ì ÇÑ °÷¸¸ °Ë»çÇصµ µÈ´Ù.
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ¹Ì Àåºñ¸¦ Âø¿ëÇÏ°í ÀÖ½À´Ï´Ù."));
			
			return false;
		}

		EquipItem(item, DestCell.cell - INVENTORY_MAX_NUM);
	}
	else
	{
		if (item->IsDragonSoul())
		{
			if (item->IsEquipped())
			{
				return DSManager::instance().PullOut(this, DestCell, item);
			}
			else
			{
				if (DestCell.window_type != DRAGON_SOUL_INVENTORY)
				{
					return false;
				}

				if (!DSManager::instance().IsValidCellForThisItem(item, DestCell))
					return false;
			}
		}
		// ¿ëÈ¥¼®ÀÌ ¾Æ´Ñ ¾ÆÀÌÅÛÀº ¿ëÈ¥¼® Àκ¥¿¡ µé¾î°¥ ¼ö ¾ø´Ù.
		else if (DRAGON_SOUL_INVENTORY == DestCell.window_type)
			return false;

		LPITEM item2;

		if ((item2 = GetItem(DestCell)) && item != item2 && item2->IsStackable() &&
				!IS_SET(item2->GetAntiFlag(), ITEM_ANTIFLAG_STACK) &&
				item2->GetVnum() == item->GetVnum()) // ÇÕÄ¥ ¼ö ÀÖ´Â ¾ÆÀÌÅÛÀÇ °æ¿ì
		{
			for (int i = 0; i < ITEM_SOCKET_MAX_NUM; ++i)
				if (item2->GetSocket(i) != item->GetSocket(i))
					return false;

			if (count == 0)
				count = item->GetCount();

			sys_log(0, "%s: ITEM_STACK %s (window: %d, cell : %d) -> (window:%d, cell %d) count %d", GetName(), item->GetName(), Cell.window_type, Cell.cell, 
				DestCell.window_type, DestCell.cell, count);

			count = MIN(200 - item2->GetCount(), count);

			item->SetCount(item->GetCount() - count);
			item2->SetCount(item2->GetCount() + count);
			return true;
		}

		if (!IsEmptyItemGrid(DestCell, item->GetSize(), Cell.cell))
			return false;

		if (count == 0 || count >= item->GetCount() || !item->IsStackable() || IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_STACK))
		{
			sys_log(0, "%s: ITEM_MOVE %s (window: %d, cell : %d) -> (window:%d, cell %d) count %d", GetName(), item->GetName(), Cell.window_type, Cell.cell, 
				DestCell.window_type, DestCell.cell, count);
			
			item->RemoveFromCharacter();
			SetItem(DestCell, item);

			if (INVENTORY == Cell.window_type && INVENTORY == DestCell.window_type)
				SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, DestCell.cell);
		}
		else if (count < item->GetCount())
		{
			//check non-split items 
			//if (LC_IsNewCIBN())
			//{
			//	if (item->GetVnum() == 71095 || item->GetVnum() == 71050 || item->GetVnum() == 70038)
			//	{
			//		return false;
			//	}
			//}

			sys_log(0, "%s: ITEM_SPLIT %s (window: %d, cell : %d) -> (window:%d, cell %d) count %d", GetName(), item->GetName(), Cell.window_type, Cell.cell, 
				DestCell.window_type, DestCell.cell, count);

			item->SetCount(item->GetCount() - count);
			LPITEM item2 = ITEM_MANAGER::instance().CreateItem(item->GetVnum(), count);

			// copy socket -- by mhh
			FN_copy_item_socket(item2, item);

			item2->AddToCharacter(this, DestCell);

			char szBuf[51+1];
			snprintf(szBuf, sizeof(szBuf), "%u %u %u %u ", item2->GetID(), item2->GetCount(), item->GetCount(), item->GetCount() + item2->GetCount());
			LogManager::instance().ItemLog(this, item, "ITEM_SPLIT", szBuf);
		}
	}

	return true;
}
 

 

Best Regards

Zerelth

Do not be sorry, be better.

Link to comment
Share on other sites

  • 3 weeks later...

Fixed, add:

if (true == pkItem->IsEquipped() && true == CBeltInventoryHelper::IsExistItemInBeltInventory(ch))
	{
	    ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Belt> You can't do this."));
		return;
	} 

under:
 

 LPITEM pkItem = ch->GetItem(p->ItemPos);

in (input_main.cpp): 
 

void CInputMain::SafeboxCheckin(LPCHARACTER ch, const char * c_pData)

can anybody test it?

Link to comment
Share on other sites

That. I don't find solve for this bug anywhere, so i do it.

 

 

Hi guys, how to fix?

 

 

 

If You have wear belt, and open safebox, you can put equipped belt into safe box, when in belt inventory are items(potions). I fix it, and you can't only put into safe box belt, when something is in belt inventory.Bug you can see on video.

Link to comment
Share on other sites

  • 2 months later...

Fixed, add:

if (true == pkItem->IsEquipped() && true == CBeltInventoryHelper::IsExistItemInBeltInventory(ch))
	{
	    ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Belt> You can't do this."));
		return;
	} 

under:

 

 LPITEM pkItem = ch->GetItem(p->ItemPos);

in (input_main.cpp): 

 

void CInputMain::SafeboxCheckin(LPCHARACTER ch, const char * c_pData)

can anybody test it?

input_main.cpp:2036: error: 'CBeltInventoryHelper' has not been declared

gmake: *** [OBJDIR/input_main.o] Error 1

 

Wtf?:D

Link to comment
Share on other sites

 

Fixed, add:

if (true == pkItem->IsEquipped() && true == CBeltInventoryHelper::IsExistItemInBeltInventory(ch))
	{
	    ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Belt> You can't do this."));
		return;
	} 

under:

 

 LPITEM pkItem = ch->GetItem(p->ItemPos);

in (input_main.cpp): 

 

void CInputMain::SafeboxCheckin(LPCHARACTER ch, const char * c_pData)

can anybody test it?

input_main.cpp:2036: error: 'CBeltInventoryHelper' has not been declared

gmake: *** [OBJDIR/input_main.o] Error 1

 

Wtf? :D

 

 

add  #include "belt_inventory_helper.h"

under #include "DragonSoul.h"

  • Love 3
Link to comment
Share on other sites

 

 

Fixed, add:

if (true == pkItem->IsEquipped() && true == CBeltInventoryHelper::IsExistItemInBeltInventory(ch))
	{
	    ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Belt> You can't do this."));
		return;
	} 

under:

 

 LPITEM pkItem = ch->GetItem(p->ItemPos);

in (input_main.cpp): 

 

void CInputMain::SafeboxCheckin(LPCHARACTER ch, const char * c_pData)

can anybody test it?

input_main.cpp:2036: error: 'CBeltInventoryHelper' has not been declared

gmake: *** [OBJDIR/input_main.o] Error 1

 

Wtf? :D

 

 

add  #include "belt_inventory_helper.h"

under #include "DragonSoul.h"

 

Thanks man... :) I'm not pay attention for this... Sry my eng! And thanks again.

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



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