Fix player color alpha after /plrclr change command (#254)

Sven Eberhardt 2010-04-18 10:18:16 +02:00
parent 23e1713990
commit 4ee3f9d011
2 changed files with 7 additions and 1 deletions

View File

@ -807,6 +807,12 @@ void C4PlayerInfoList::UpdatePlayerAttributes(C4ClientPlayerInfos *pForInfo, boo
pInfo->SetColor(dwForceClr);
pForInfo->SetUpdated();
}
// make sure colors have correct alpha (modified engines might send malformed packages of transparent colors)
if ((pInfo->GetColor() & 0xff000000u) != 0xff000000u)
{
pInfo->SetColor(pInfo->GetColor() | 0xff000000u);
pForInfo->SetUpdated();
}
}
if (fResolveConflicts) ResolvePlayerAttributeConflicts(pForInfo);
}

View File

@ -540,7 +540,7 @@ namespace C4GameLobby
else
{
// color validation
dwNewClr &= 0xffffff;
dwNewClr |= 0xff000000;
if (!dwNewClr) ++dwNewClr;
// request a color change to this color
C4ClientPlayerInfos LocalInfoRequest = *pCltNfo;