Merge pull request #5 from diamante0018/colordblind_team_colors

Correct one mistake
This commit is contained in:
Edoardo Sanguineti 2021-07-28 14:41:45 +02:00 committed by GitHub
commit 0707c8b99f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View File

@ -221,7 +221,7 @@ namespace Components
// Patches team overhead normally // Patches team overhead normally
int Colors::Dvar_GetUnpackedColorByName(const char* name, float* color) bool Colors::Dvar_GetUnpackedColorByName(const char* name, float* color)
{ {
if (Colors::ColorBlind.get<bool>()) if (Colors::ColorBlind.get<bool>())
{ {
@ -232,7 +232,7 @@ namespace Components
color[0] = 0.659f; color[0] = 0.659f;
color[1] = 0.088f; color[1] = 0.088f;
color[2] = 0.145f; color[2] = 0.145f;
return 0; return false;
} }
else if (str.compare("g_TeamColor_MyTeam") == 0) else if (str.compare("g_TeamColor_MyTeam") == 0)
{ {
@ -240,11 +240,11 @@ namespace Components
color[0] = 1.f; color[0] = 1.f;
color[1] = 0.859f; color[1] = 0.859f;
color[2] = 0.125f; color[2] = 0.125f;
return 0; return false;
} }
} }
return 1; return true;
} }
__declspec(naked) void Colors::GetUnpackedColorByNameStub() __declspec(naked) void Colors::GetUnpackedColorByNameStub()
@ -255,7 +255,7 @@ namespace Components
pushad pushad
push [esp + 2Ch] push [esp + 2Ch]
push [esp + 2Ch]; push [esp + 2Ch]
call Colors::Dvar_GetUnpackedColorByName call Colors::Dvar_GetUnpackedColorByName
add esp, 8h add esp, 8h
@ -264,17 +264,18 @@ namespace Components
popad popad
pop eax pop eax
test eax, eax test al, al
jnz continue jz dontContinue
xor eax, eax mov eax, [esp + 8]
retn
continue:
push edi push edi
mov edi, dword ptr[esp + 4h] mov edi, dword ptr[esp + 4h]
push 406535h mov ecx, 406535h
jmp ecx
dontContinue:
xor eax, eax
retn retn
} }
} }

View File

@ -36,7 +36,7 @@ namespace Components
static void LookupColor(DWORD* color, char index); static void LookupColor(DWORD* color, char index);
static void LookupColorStub(); static void LookupColorStub();
static char* CleanStrStub(char* string); static char* CleanStrStub(char* string);
static int Dvar_GetUnpackedColorByName(const char* name, float* color); static bool Dvar_GetUnpackedColorByName(const char* name, float* color);
static void GetUnpackedColorByNameStub(); static void GetUnpackedColorByNameStub();
static std::vector<DWORD> ColorTable; static std::vector<DWORD> ColorTable;
}; };