Fix color toggles

This commit is contained in:
Learath 2020-06-27 15:12:53 +03:00
parent a56fbbc340
commit af2e02ccd2

View file

@ -881,9 +881,8 @@ void CConsole::ConToggle(IConsole::IResult *pResult, void *pUser)
bool Alpha = pData->m_Alpha;
unsigned Cur = *pData->m_pVariable;
ColorHSLA Val = Cur == pResult->GetColor(1, Light).Pack(Darkest, Alpha) ? pResult->GetColor(2, Light) : pResult->GetColor(1, Light);
Cur = Val.Pack(Darkest, Alpha);
str_format(aBuf, sizeof(aBuf), "%s %u", pResult->GetString(0), Val.Pack(Alpha));
str_format(aBuf, sizeof(aBuf), "%s %u", pResult->GetString(0), Val.Pack(Darkest, Alpha));
pConsole->ExecuteLine(aBuf);
aBuf[0] = 0;
}