comparison Player.cpp @ 749:f39fbeb65b28

Fixed bought items not disappearing from Armourer.
author Nomad
date Fri, 22 Mar 2013 23:26:01 +0200
parents 6daaa2f18d0d
children 0b3f4b854652
comparison
equal deleted inserted replaced
748:daecb0225226 749:f39fbeb65b28
334 result = v3; 334 result = v3;
335 return result; 335 return result;
336 } 336 }
337 337
338 //----- (004B8142) -------------------------------------------------------- 338 //----- (004B8142) --------------------------------------------------------
339 int Player::_4B8142(int a2, float a3) 339 int Player::GetBuyingPrice(unsigned int uRealValue, float price_multiplier)
340 { 340 {
341 int result; // eax@1 341 uint price = ((100 - GetMerchant()) * (uRealValue * price_multiplier)) / 100;
342 342 assert (price > 0);
343 result = (int)((100 - GetMerchant()) * (unsigned __int64)(signed __int64)((double)a2 * a3)) / 100; 343
344 if ( result < a2 ) 344 if (price < uRealValue)
345 result = a2; 345 price = uRealValue;
346 if ( result < 1 ) 346 return price;
347 result = 1;
348 return result;
349 } 347 }
350 348
351 //----- (004B8179) -------------------------------------------------------- 349 //----- (004B8179) --------------------------------------------------------
352 int Player::_4B8179(float a2) 350 int Player::_4B8179(float a2)
353 { 351 {
1856 LABEL_26: 1854 LABEL_26:
1857 //v14 = &p2DEvents_minus1__20[13 * a4]; 1855 //v14 = &p2DEvents_minus1__20[13 * a4];
1858 v14 = &p2DEvents[a4 - 1].fPriceMultiplier; 1856 v14 = &p2DEvents[a4 - 1].fPriceMultiplier;
1859 v15 = *v14; 1857 v15 = *v14;
1860 v16 = pItem->GetValue(); 1858 v16 = pItem->GetValue();
1861 v17 = _4B8142(v16, v15); 1859 v17 = GetBuyingPrice(v16, v15);
1862 if ( a5 == 3 ) 1860 if ( a5 == 3 )
1863 { 1861 {
1864 v23 = *v14; 1862 v23 = *v14;
1865 v24 = pItem->GetValue(); 1863 v24 = pItem->GetValue();
1866 v17 = v27->_4B8102(v24, v23); 1864 v17 = v27->_4B8102(v24, v23);