Mercurial > mm7
diff Player.cpp @ 297:ada52edca264
m
author | Ritor1 |
---|---|
date | Tue, 19 Feb 2013 09:13:51 +0600 |
parents | 0a37a56e9f02 |
children | 055cea8660e5 |
line wrap: on
line diff
--- a/Player.cpp Mon Feb 18 16:39:49 2013 +0600 +++ b/Player.cpp Tue Feb 19 09:13:51 2013 +0600 @@ -6833,26 +6833,26 @@ } //----- (004907E7) -------------------------------------------------------- -__int16 Player::GetStatColor(unsigned int uStat) -{ - Player *v2; // edi@1 - __int16 uWhite; // si@1 +unsigned int Player::GetStatColor(int uStat) +{ + //Player *v2; // edi@1 + unsigned int uWhite; // si@1 // int uStartingHP; // eax@1 - int v5; // edx@1 + //int v5; // edx@1 // unsigned __int8 v6; // zf@1 // char v7; // sf@1 - unsigned __int8 v8; // of@1 - __int16 result; // ax@2 - __int16 uGreen; // [sp+8h] [bp-8h]@1 - __int16 uRed; // [sp+Ch] [bp-4h]@1 - - v2 = this; + int v8; // of@1 + //__int16 result; // ax@2 + unsigned int uGreen; // [sp+8h] [bp-8h]@1 + unsigned int uRed; // [sp+Ch] [bp-4h]@1 + int attribute_value; + + //v2 = this; uRed = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x23u, 0); uGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); uWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); v8 = stru_4ED7B0.race[GetRace()].attr[uStat].uBaseValue; - int attribute_value = 0; switch (uStat) { case 0: attribute_value = uMight; break; @@ -6864,18 +6864,12 @@ case 6: attribute_value = uLuck; break; }; - v5 = attribute_value; - if ( v5 >= v8 ) - { - result = uGreen; - if ( v5 == v8 ) - result = uWhite; - } + if ( attribute_value == v8 ) + return uWhite; + else if ( attribute_value > v8 ) + return uGreen; else - { - result = uRed; - } - return result; + return uRed; } //----- (004908A8) --------------------------------------------------------