Jump to content
  • 0

Auto potion problem


Tallywa

Question

Hello, I have a problem, here is when my auto potions are stacked and I activate one, once the potion is emptied, it disappears, but make the entire stack disappear. How to fix the problem?

Link to post

2 answers to this question

Recommended Posts

  • 0

please test it and report here the result. I'v not the time to test it for you.

 

 

into the function

void CHARACTER::AutoRecoveryItemProcess(const EAffectTypes type)

 

 

search for

					if (avail > amount)
					{
						const int pct_of_used = amount_of_used * 100 / amount_of_full;
						const int pct_of_will_used = (amount_of_used + amount) * 100 / amount_of_full;

						bool bLog = false;
						
						
						if ((pct_of_will_used / 10) - (pct_of_used / 10) >= 1)
							bLog = true;
						pItem->SetSocket(idx_of_amount_of_used, amount_of_used + amount, bLog);
					}
					else
					{
						amount = avail;

						ITEM_MANAGER::instance().RemoveItem( pItem );
					}

 

 

replace it with:
 

					if (avail > amount)
					{
						const int pct_of_used = amount_of_used * 100 / amount_of_full;
						const int pct_of_will_used = (amount_of_used + amount) * 100 / amount_of_full;

						bool bLog = false;
						
						
						if ((pct_of_will_used / 10) - (pct_of_used / 10) >= 1)
							bLog = true;
						pItem->SetSocket(idx_of_amount_of_used, amount_of_used + amount, bLog);
					}
					else
					{
						amount = avail;

						if(pItem->GetCount() <= 1)
							ITEM_MANAGER::instance().RemoveItem( pItem );

						else
						{
							pItem->SetCount(pItem->GetCount() - 1);
							pItem->SetSocket(1, 0);
						}
					}

 

My youtube channel  on which you can see my works here

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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