Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sjrc6 committed May 12, 2022
1 parent 8ba33f6 commit fa237ac
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
12 changes: 10 additions & 2 deletions src/game/client/components/menus_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,16 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
RandomColorsButton.VSplitLeft(150.0f, &RandomColorsButton, 0);
if(DoButton_Menu(&s_RandomizeColors, "Randomize Colors", 0, &RandomColorsButton, 0, CUI::CORNER_ALL, 5.0f, 0.0f, vec4(0, 0, 0, 0.5f), vec4(0, 0, 0, 0.25f)))
{
g_Config.m_ClPlayerColorBody = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false);
g_Config.m_ClPlayerColorFeet = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false);
if(m_Dummy)
{
g_Config.m_ClDummyColorBody = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false);
g_Config.m_ClDummyColorFeet = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false);
}
else
{
g_Config.m_ClPlayerColorBody = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false);
g_Config.m_ClPlayerColorFeet = ColorHSLA((std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, (std::rand() % 100) / 100.0f, 1).Pack(false);
}
SetNeedSendInfo();
m_DoubleClickIndex = -1;
}
Expand Down
29 changes: 10 additions & 19 deletions src/game/client/components/outlines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ void COutlines::OnRender()
CMapItemGroup *pGroup = GameClient()->Layers()->GetGroup(g);

if(!pGroup)

continue;

bool PassedGameLayer = false;

CTile *pGameTiles = NULL;
Expand All @@ -48,29 +48,18 @@ void COutlines::OnRender()
IsEntityLayer = IsGameLayer = true;
PassedGameLayer = true;
}
if(pLayer == (CMapItemLayer *)GameClient()->Layers()->FrontLayer())
IsEntityLayer = IsFrontLayer = true;

if(pLayer == (CMapItemLayer *)GameClient()->Layers()->SwitchLayer())
IsEntityLayer = IsSwitchLayer = true;

if(pLayer == (CMapItemLayer *)GameClient()->Layers()->TeleLayer())
IsEntityLayer = IsTeleLayer = true;

if(pLayer == (CMapItemLayer *)GameClient()->Layers()->SpeedupLayer())
IsEntityLayer = IsSpeedupLayer = true;

if(pLayer == (CMapItemLayer *)GameClient()->Layers()->TuneLayer())
IsEntityLayer = IsTuneLayer = true;

if(g_Config.m_ClOutline && IsGameLayer)
{
CMapItemLayerTilemap *pTMap = (CMapItemLayerTilemap *)pLayer;

if(!pTMap)
return;
CTile *pTiles = (CTile *)GameClient()->Layers()->Map()->GetData(pTMap->m_Data);
unsigned int Size = GameClient()->Layers()->Map()->GetDataSize(pTMap->m_Data);
if(!pTiles || !pTMap)
if(!pTiles)
return;
unsigned int Size = GameClient()->Layers()->Map()->GetDataSize(pTMap->m_Data);
if(IsGameLayer)
pGameTiles = pTiles;
if((g_Config.m_ClOutlineFreeze || g_Config.m_ClOutlineSolid || g_Config.m_ClOutlineUnFreeze) && IsGameLayer && Size >= (size_t)pTMap->m_Width * pTMap->m_Height * sizeof(CTile))
Expand All @@ -86,10 +75,12 @@ void COutlines::OnRender()
if(g_Config.m_ClOutline && IsTeleLayer)
{
CMapItemLayerTilemap *pTMap = (CMapItemLayerTilemap *)pLayer;
if(!pTMap)
return;
CTile *pTiles = (CTile *)GameClient()->Layers()->Map()->GetData(pTMap->m_Data);
unsigned int Size = GameClient()->Layers()->Map()->GetDataSize(pTMap->m_Data);
if(!pTiles || !pTMap)
if(!pTiles)
return;
unsigned int Size = GameClient()->Layers()->Map()->GetDataSize(pTMap->m_Data);
if(IsGameLayer)
pGameTiles = pTiles;
if(g_Config.m_ClOutlineTele && IsTeleLayer)
Expand Down

0 comments on commit fa237ac

Please sign in to comment.