Merge pull request #15 from diamante0018/colordblind_team_colors

Finally a working stub
This commit is contained in:
Edoardo Sanguineti 2021-07-31 19:28:57 +02:00 committed by GitHub
commit 15f05bc4be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -225,7 +225,7 @@ namespace Components
if (Colors::ColorBlind.get<bool>()) if (Colors::ColorBlind.get<bool>())
{ {
auto str = std::string(name); auto str = std::string(name);
if (str.compare("g_TeamColor_EnemyTeam") == 0) if (!str.compare("g_TeamColor_EnemyTeam"))
{ {
// A dark red // A dark red
color[0] = 0.659f; color[0] = 0.659f;
@ -233,7 +233,7 @@ namespace Components
color[2] = 0.145f; color[2] = 0.145f;
return false; return false;
} }
else if (str.compare("g_TeamColor_MyTeam") == 0) else if (!str.compare("g_TeamColor_MyTeam"))
{ {
// A bright yellow // A bright yellow
color[0] = 1.f; color[0] = 1.f;
@ -250,28 +250,20 @@ namespace Components
{ {
__asm __asm
{ {
push eax push [esp + 8h]
pushad push [esp + 8h]
push [esp + 2Ch]
push [esp + 2Ch]
call Colors::Dvar_GetUnpackedColorByName call Colors::Dvar_GetUnpackedColorByName
add esp, 8h add esp, 8h
mov [esp + 20h], eax
popad
pop eax
test al, al test al, al
jz dontContinue jnz continue
push edi
mov edi, dword ptr[esp + 4h]
push 406535h
retn retn
dontContinue: continue:
xor eax, eax push edi
mov edi, [esp + 8h]
push 406535h
retn retn
} }
} }