Mercurial > mm7
diff Player.cpp @ 1275:7569c88d9cb0
renamed a few unnamed functions
author | Grumpy7 |
---|---|
date | Sat, 15 Jun 2013 06:51:04 +0200 |
parents | 351bc06722f2 |
children | f11651288371 |
line wrap: on
line diff
--- a/Player.cpp Sat Jun 15 05:08:48 2013 +0200 +++ b/Player.cpp Sat Jun 15 06:51:04 2013 +0200 @@ -200,9 +200,9 @@ //----- (00427730) -------------------------------------------------------- bool Player::CanCastSpell(unsigned int uRequiredMana) { - if (sMana >= uRequiredMana) - { - sMana -= uRequiredMana; + if (sMana >= (signed int)uRequiredMana) + { + sMana -= (signed int)uRequiredMana; return true; } @@ -266,9 +266,9 @@ int v6; // eax@8 signed int result; // qax@13 signed int baseConditionMultiplier; // [sp+8h] [bp-8h]@4 - + conditionIdx = GetMajorConditionIdx(); - if ( conditionIdx >= 14 ) + if ( conditionIdx >= 14 && conditionIdx <= 16) { if ( conditionIdx <= 15 ) { @@ -280,7 +280,7 @@ } conditionTimeMultiplier = GetConditionDayOfWeek(conditionIdx); } - else + else if (conditionIdx < 14) { baseConditionMultiplier = 1; conditionTimeMultiplier = 0; @@ -293,7 +293,11 @@ if ( !conditionTimeMultiplier ) conditionTimeMultiplier = 1; } - result = ((double)conditionTimeMultiplier * (double)baseConditionMultiplier * a2); + else{ + conditionTimeMultiplier = 1; + baseConditionMultiplier = 1; + } + result = (int)((double)conditionTimeMultiplier * (double)baseConditionMultiplier * a2); if ( result < 1 ) result = 1; return result; @@ -305,7 +309,7 @@ signed int v3; // esi@1 signed int result; // eax@3 - v3 = (unsigned __int64)(signed __int64)((double)uRealValue / (price_multiplier + 2.0)) + uRealValue * GetMerchant() / 100; + v3 = (signed int)((signed __int64)((double)uRealValue / (price_multiplier + 2.0)) + uRealValue * GetMerchant() / 100); if ( v3 > uRealValue ) v3 = uRealValue; result = 1; @@ -317,7 +321,7 @@ //----- (004B8142) -------------------------------------------------------- int Player::GetBuyingPrice(unsigned int uRealValue, float price_multiplier) { - uint price = ((100 - GetMerchant()) * (uRealValue * price_multiplier)) / 100; + uint price = (uint)(((100 - GetMerchant()) * (uRealValue * price_multiplier)) / 100); assert (price > 0); if (price < uRealValue) @@ -332,7 +336,7 @@ int v3; // ecx@1 signed int result; // eax@3 - v2 = (signed __int64)(a2 * 50.0); + v2 = (signed int)(a2 * 50.0); v3 = v2 * (100 - GetMerchant()) / 100; if ( v3 < v2 / 3 ) v3 = v2 / 3; @@ -349,7 +353,7 @@ int v4; // ecx@1 signed int result; // eax@3 - v3 = (signed __int64)((double)a2 / (6.0 - a3)); + v3 = (signed int)((double)a2 / (6.0 - a3)); v4 = v3 * (100 - GetMerchant()) / 100; if ( v4 < v3 / 3 ) v4 = v3 / 3; @@ -360,46 +364,46 @@ } //----- (004B8213) -------------------------------------------------------- -int Player::_4B8213(int a2, float a3) -{ - signed __int64 v3; // qax@1 - - v3 = (signed __int64)((double)a2 / (a3 + 2.0)); - if ( (signed int)v3 < 1 ) - LODWORD(v3) = 1; +int Player::GetBaseSellingPrice(int a2, float a3) +{ + signed int v3; // qax@1 + + v3 = (signed int)((double)a2 / (a3 + 2.0)); + if ( v3 < 1 ) + v3 = 1; return v3; } //----- (004B8233) -------------------------------------------------------- -int Player::_4B8233(int a2, float a3) -{ - signed __int64 v3; // qax@1 - - v3 = (signed __int64)((double)a2 * a3); - if ( (signed int)v3 < 1 ) - LODWORD(v3) = 1; +int Player::GetBaseBuyingPrice(int a2, float a3) +{ + signed int v3; // qax@1 + + v3 = (signed int)((double)a2 * a3); + if ( v3 < 1 ) + v3 = 1; return v3; } //----- (004B824B) -------------------------------------------------------- -int Player::_4B824B(float a2) -{ - signed __int64 v2; // qax@1 - - v2 = (signed __int64)(a2 * 50.0); - if ( (signed int)v2 < 1 ) - LODWORD(v2) = 1; +int Player::GetBaseIdentifyPrice(float a2) +{ + signed int v2; // qax@1 + + v2 = (signed int)(a2 * 50.0); + if ( v2 < 1 ) + v2 = 1; return v2; } //----- (004B8265) -------------------------------------------------------- -int Player::_4B8265(int a2, float a3) -{ - signed __int64 v3; // qax@1 - - v3 = (signed __int64)((double)a2 / (6.0 - a3)); - if ( (signed int)v3 < 1 ) - LODWORD(v3) = 1; +int Player::GetBaseRepairPrice(int a2, float a3) +{ + signed int v3; // qax@1 + + v3 = (signed int)((double)a2 / (6.0 - a3)); + if ( v3 < 1 ) + v3 = 1; return v3; }