Fix worst local variable style offenses

Removed member prefix m_ used for local variables.
Removed all b, c, i hungarian notation prefixes for boolean, const and integers.
Fixed local variables using lower_snake_case instead of UpperCamelCase.
Renamed all ``float wSearch = TextRender()->TextWidth..`` to ``float SearchWidth = ..``.
This commit is contained in:
ChillerDragon 2024-03-25 13:05:47 +08:00
parent fc180562f6
commit fcbd1fb1b1
13 changed files with 48 additions and 48 deletions

View file

@ -102,5 +102,5 @@ CheckOptions:
- key: readability-identifier-naming.LocalConstantCase - key: readability-identifier-naming.LocalConstantCase
value: aNy_CasE value: aNy_CasE
- key: readability-identifier-naming.LocalVariableIgnoredRegexp - key: readability-identifier-naming.LocalVariableIgnoredRegexp
value: '^(p|a|s_|FT_|TB_|s_|ul_|v|[xy]i$|[zijklxyhmrgbacwestnduvqf]$|[dmpwsitcf][xy]$|(ch|skel)[0-2]?$|it$|tw$|dt$|th$|ls$|func$|res$|shader$|len$|maxLength$|length$|offset$|offpos$|result$|bg$|sp$|url$|Tickdelta_legacy$|index$|ctxt$|key$|null$|logger$|LAST_MODIFIED$|GfxFsaaSamples_MouseButton$|teleNr$|target$|id$|hit$|hsl[0-2]?$|rgb[0-2]?$|dir$|tmp$|cData$|sub$|ret$|rendered$|(lower|upper)(16|26|24|32)|size$|wSearch$|bAlreadyHit$|isWeaponCollide$|zerochar$|dist$|sound$|match$|best_skin$|best_matches$|m_aClient$|matches$|nohook$|through_cut$|btn$|savedLayers$|l[hw]$|evilz$|sec$|min$|to2$|delay$|m_TileF?Index$|mode$|maxModes$|numModes$|iLogLength$|[xy]Fract$|[xy]Int$|imgg[xy]$|skip$|localPlayer$|fdratio$|[rgbat][0-2]$|[xy][0-3]$|x[rl]$).*' value: '^(p|a|s_|FT_|TB_|s_|ul_|v|[xy]i$|[zijklxyhmrgbacwestnduvqf]$|[dmpwsitcf][xy]$|(ch|skel)[0-2]?$|it$|tw$|dt$|th$|ls$|func$|res$|shader$|len$|maxLength$|length$|offset$|offpos$|result$|bg$|sp$|url$|index$|ctxt$|key$|null$|logger$|LAST_MODIFIED$|teleNr$|target$|id$|hit$|hsl[0-2]?$|rgb[0-2]?$|dir$|tmp$|sub$|ret$|rendered$|(lower|upper)(16|26|24|32)|size$|isWeaponCollide$|zerochar$|dist$|sound$|match$|best_matches$|matches$|nohook$|btn$|savedLayers$|l[hw]$|evilz$|sec$|min$|to2$|delay$|mode$|maxModes$|numModes$|[xy]Fract$|[xy]Int$|imgg[xy]$|skip$|localPlayer$|fdratio$|[rgbat][0-2]$|[xy][0-3]$|x[rl]$).*'

View file

@ -58,8 +58,8 @@ void CGLSLProgram::LinkProgram()
{ {
char aInfoLog[1024]; char aInfoLog[1024];
char aFinalMessage[1536]; char aFinalMessage[1536];
int iLogLength; int LogLength;
glGetProgramInfoLog(m_ProgramId, 1024, &iLogLength, aInfoLog); glGetProgramInfoLog(m_ProgramId, 1024, &LogLength, aInfoLog);
str_format(aFinalMessage, sizeof(aFinalMessage), "Error! Shader program wasn't linked! The linker returned:\n\n%s", aInfoLog); str_format(aFinalMessage, sizeof(aFinalMessage), "Error! Shader program wasn't linked! The linker returned:\n\n%s", aInfoLog);
dbg_msg("glslprogram", "%s", aFinalMessage); dbg_msg("glslprogram", "%s", aFinalMessage);
} }

View file

@ -493,15 +493,15 @@ CDemoPlayer::EReadChunkHeaderResult CDemoPlayer::ReadChunkHeader(int *pType, int
if(Chunk & CHUNKTYPEFLAG_TICKMARKER) if(Chunk & CHUNKTYPEFLAG_TICKMARKER)
{ {
// decode tick marker // decode tick marker
int Tickdelta_legacy = Chunk & CHUNKMASK_TICK_LEGACY; // compatibility int TickdeltaLegacy = Chunk & CHUNKMASK_TICK_LEGACY; // compatibility
*pType = Chunk & (CHUNKTYPEFLAG_TICKMARKER | CHUNKTICKFLAG_KEYFRAME); *pType = Chunk & (CHUNKTYPEFLAG_TICKMARKER | CHUNKTICKFLAG_KEYFRAME);
int NewTick; int NewTick;
if(m_Info.m_Header.m_Version < gs_VersionTickCompression && Tickdelta_legacy != 0) if(m_Info.m_Header.m_Version < gs_VersionTickCompression && TickdeltaLegacy != 0)
{ {
if(*pTick < 0) // initial tick not initialized before a tick delta if(*pTick < 0) // initial tick not initialized before a tick delta
return CHUNKHEADER_ERROR; return CHUNKHEADER_ERROR;
NewTick = *pTick + Tickdelta_legacy; NewTick = *pTick + TickdeltaLegacy;
} }
else if(Chunk & CHUNKTICKFLAG_TICK_COMPRESSED) else if(Chunk & CHUNKTICKFLAG_TICK_COMPRESSED)
{ {

View file

@ -677,10 +677,10 @@ void CMenus::RenderServerControl(CUIRect MainView)
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE); TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);
Ui()->DoLabel(&QuickSearch, FONT_ICON_MAGNIFYING_GLASS, 14.0f, TEXTALIGN_ML); Ui()->DoLabel(&QuickSearch, FONT_ICON_MAGNIFYING_GLASS, 14.0f, TEXTALIGN_ML);
float wSearch = TextRender()->TextWidth(14.0f, FONT_ICON_MAGNIFYING_GLASS, -1, -1.0f); float SearchWidth = TextRender()->TextWidth(14.0f, FONT_ICON_MAGNIFYING_GLASS, -1, -1.0f);
TextRender()->SetRenderFlags(0); TextRender()->SetRenderFlags(0);
TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT);
QuickSearch.VSplitLeft(wSearch, 0, &QuickSearch); QuickSearch.VSplitLeft(SearchWidth, 0, &QuickSearch);
QuickSearch.VSplitLeft(5.0f, 0, &QuickSearch); QuickSearch.VSplitLeft(5.0f, 0, &QuickSearch);
if(m_ControlPageOpening || (Input()->KeyPress(KEY_F) && Input()->ModifierIsPressed())) if(m_ControlPageOpening || (Input()->KeyPress(KEY_F) && Input()->ModifierIsPressed()))

View file

@ -394,8 +394,8 @@ void CMenus::RenderSettingsPlayer(CUIRect MainView)
TextRender()->SetRenderFlags(0); TextRender()->SetRenderFlags(0);
TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT);
float wSearch = TextRender()->TextWidth(14.0f, FONT_ICON_MAGNIFYING_GLASS, -1, -1.0f); float SearchWidth = TextRender()->TextWidth(14.0f, FONT_ICON_MAGNIFYING_GLASS, -1, -1.0f);
QuickSearch.VSplitLeft(wSearch - 1.5f, nullptr, &QuickSearch); QuickSearch.VSplitLeft(SearchWidth - 1.5f, nullptr, &QuickSearch);
QuickSearch.VSplitLeft(5.0f, nullptr, &QuickSearch); QuickSearch.VSplitLeft(5.0f, nullptr, &QuickSearch);
QuickSearch.VSplitLeft(QuickSearch.w - 10.0f, &QuickSearch, &QuickSearchClearButton); QuickSearch.VSplitLeft(QuickSearch.w - 10.0f, &QuickSearch, &QuickSearchClearButton);
@ -919,10 +919,10 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
TextRender()->SetFontPreset(EFontPreset::ICON_FONT); TextRender()->SetFontPreset(EFontPreset::ICON_FONT);
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE); TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);
Ui()->DoLabel(&QuickSearch, FONT_ICON_MAGNIFYING_GLASS, 14.0f, TEXTALIGN_ML); Ui()->DoLabel(&QuickSearch, FONT_ICON_MAGNIFYING_GLASS, 14.0f, TEXTALIGN_ML);
float wSearch = TextRender()->TextWidth(14.0f, FONT_ICON_MAGNIFYING_GLASS, -1, -1.0f); float SearchWidth = TextRender()->TextWidth(14.0f, FONT_ICON_MAGNIFYING_GLASS, -1, -1.0f);
TextRender()->SetRenderFlags(0); TextRender()->SetRenderFlags(0);
TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT);
QuickSearch.VSplitLeft(wSearch + 5.0f, nullptr, &QuickSearch); QuickSearch.VSplitLeft(SearchWidth + 5.0f, nullptr, &QuickSearch);
static CLineInput s_SkinFilterInput(g_Config.m_ClSkinFilterString, sizeof(g_Config.m_ClSkinFilterString)); static CLineInput s_SkinFilterInput(g_Config.m_ClSkinFilterString, sizeof(g_Config.m_ClSkinFilterString));
if(Input()->KeyPress(KEY_F) && Input()->ModifierIsPressed()) if(Input()->KeyPress(KEY_F) && Input()->ModifierIsPressed())
{ {
@ -1635,16 +1635,16 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
bool MultiSamplingChanged = false; bool MultiSamplingChanged = false;
MainView.HSplitTop(20.0f, &Button, &MainView); MainView.HSplitTop(20.0f, &Button, &MainView);
str_format(aBuf, sizeof(aBuf), "%s (%s)", Localize("FSAA samples"), Localize("may cause delay")); str_format(aBuf, sizeof(aBuf), "%s (%s)", Localize("FSAA samples"), Localize("may cause delay"));
int GfxFsaaSamples_MouseButton = DoButton_CheckBox_Number(&g_Config.m_GfxFsaaSamples, aBuf, g_Config.m_GfxFsaaSamples, &Button); int GfxFsaaSamplesMouseButton = DoButton_CheckBox_Number(&g_Config.m_GfxFsaaSamples, aBuf, g_Config.m_GfxFsaaSamples, &Button);
int CurFSAA = g_Config.m_GfxFsaaSamples == 0 ? 1 : g_Config.m_GfxFsaaSamples; int CurFSAA = g_Config.m_GfxFsaaSamples == 0 ? 1 : g_Config.m_GfxFsaaSamples;
if(GfxFsaaSamples_MouseButton == 1) // inc if(GfxFsaaSamplesMouseButton == 1) // inc
{ {
g_Config.m_GfxFsaaSamples = std::pow(2, (int)std::log2(CurFSAA) + 1); g_Config.m_GfxFsaaSamples = std::pow(2, (int)std::log2(CurFSAA) + 1);
if(g_Config.m_GfxFsaaSamples > 64) if(g_Config.m_GfxFsaaSamples > 64)
g_Config.m_GfxFsaaSamples = 0; g_Config.m_GfxFsaaSamples = 0;
MultiSamplingChanged = true; MultiSamplingChanged = true;
} }
else if(GfxFsaaSamples_MouseButton == 2) // dec else if(GfxFsaaSamplesMouseButton == 2) // dec
{ {
if(CurFSAA == 1) if(CurFSAA == 1)
g_Config.m_GfxFsaaSamples = 64; g_Config.m_GfxFsaaSamples = 64;
@ -1662,7 +1662,7 @@ void CMenus::RenderSettingsGraphics(CUIRect MainView)
{ {
// try again with 0 if mouse click was increasing multi sampling // try again with 0 if mouse click was increasing multi sampling
// else just accept the current value as is // else just accept the current value as is
if((uint32_t)g_Config.m_GfxFsaaSamples > MultiSamplingCountBackend && GfxFsaaSamples_MouseButton == 1) if((uint32_t)g_Config.m_GfxFsaaSamples > MultiSamplingCountBackend && GfxFsaaSamplesMouseButton == 1)
Graphics()->SetMultiSampling(0, MultiSamplingCountBackend); Graphics()->SetMultiSampling(0, MultiSamplingCountBackend);
g_Config.m_GfxFsaaSamples = (int)MultiSamplingCountBackend; g_Config.m_GfxFsaaSamples = (int)MultiSamplingCountBackend;
} }

View file

@ -608,10 +608,10 @@ void CMenus::RenderSettingsCustom(CUIRect MainView)
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE); TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);
Ui()->DoLabel(&QuickSearch, FONT_ICON_MAGNIFYING_GLASS, 14.0f, TEXTALIGN_ML); Ui()->DoLabel(&QuickSearch, FONT_ICON_MAGNIFYING_GLASS, 14.0f, TEXTALIGN_ML);
float wSearch = TextRender()->TextWidth(14.0f, FONT_ICON_MAGNIFYING_GLASS, -1, -1.0f); float SearchWidth = TextRender()->TextWidth(14.0f, FONT_ICON_MAGNIFYING_GLASS, -1, -1.0f);
TextRender()->SetRenderFlags(0); TextRender()->SetRenderFlags(0);
TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT);
QuickSearch.VSplitLeft(wSearch, 0, &QuickSearch); QuickSearch.VSplitLeft(SearchWidth, 0, &QuickSearch);
QuickSearch.VSplitLeft(5.0f, 0, &QuickSearch); QuickSearch.VSplitLeft(5.0f, 0, &QuickSearch);
QuickSearch.VSplitLeft(QuickSearch.w - 10.0f, &QuickSearch, &QuickSearchClearButton); QuickSearch.VSplitLeft(QuickSearch.w - 10.0f, &QuickSearch, &QuickSearchClearButton);
if(Input()->KeyPress(KEY_F) && Input()->ModifierIsPressed()) if(Input()->KeyPress(KEY_F) && Input()->ModifierIsPressed())

View file

@ -832,13 +832,13 @@ void CPlayers::OnRender()
} }
// render spectating players // render spectating players
for(auto &m_aClient : m_pClient->m_aClients) for(auto &Client : m_pClient->m_aClients)
{ {
if(!m_aClient.m_SpecCharPresent) if(!Client.m_SpecCharPresent)
{ {
continue; continue;
} }
RenderTools()->RenderTee(CAnimState::GetIdle(), &RenderInfoSpec, EMOTE_BLINK, vec2(1, 0), m_aClient.m_SpecChar); RenderTools()->RenderTee(CAnimState::GetIdle(), &RenderInfoSpec, EMOTE_BLINK, vec2(1, 0), Client.m_SpecChar);
} }
// render everyone else's tee, then either our own or the tee we are spectating. // render everyone else's tee, then either our own or the tee we are spectating.

View file

@ -2469,9 +2469,9 @@ int CGameClient::IntersectCharacter(vec2 HookPos, vec2 NewPos, vec2 &NewPos2, in
if(i == ownId) if(i == ownId)
continue; continue;
const CClientData &cData = m_aClients[i]; const CClientData &Data = m_aClients[i];
if(!cData.m_Active) if(!Data.m_Active)
continue; continue;
CNetObj_Character Prev = m_Snap.m_aCharacters[i].m_Prev; CNetObj_Character Prev = m_Snap.m_aCharacters[i].m_Prev;
@ -2479,8 +2479,8 @@ int CGameClient::IntersectCharacter(vec2 HookPos, vec2 NewPos, vec2 &NewPos2, in
vec2 Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), Client()->IntraGameTick(g_Config.m_ClDummy)); vec2 Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), Client()->IntraGameTick(g_Config.m_ClDummy));
bool IsOneSuper = cData.m_Super || OwnClientData.m_Super; bool IsOneSuper = Data.m_Super || OwnClientData.m_Super;
bool IsOneSolo = cData.m_Solo || OwnClientData.m_Solo; bool IsOneSolo = Data.m_Solo || OwnClientData.m_Solo;
if(!IsOneSuper && (!m_Teams.SameTeam(i, ownId) || IsOneSolo || OwnClientData.m_HookHitDisabled)) if(!IsOneSuper && (!m_Teams.SameTeam(i, ownId) || IsOneSolo || OwnClientData.m_HookHitDisabled))
continue; continue;

View file

@ -160,13 +160,13 @@ void CCharacter::HandleNinja()
return; return;
// make sure we haven't Hit this object before // make sure we haven't Hit this object before
bool bAlreadyHit = false; bool AlreadyHit = false;
for(int j = 0; j < m_NumObjectsHit; j++) for(int j = 0; j < m_NumObjectsHit; j++)
{ {
if(m_aHitObjects[j] == pChr->GetCid()) if(m_aHitObjects[j] == pChr->GetCid())
bAlreadyHit = true; AlreadyHit = true;
} }
if(bAlreadyHit) if(AlreadyHit)
continue; continue;
// check so we are sufficiently close // check so we are sufficiently close

View file

@ -17,8 +17,8 @@ CTile CLayerGame::GetTile(int x, int y)
{ {
if(m_pEditor->m_Map.m_pFrontLayer && m_pEditor->m_Map.m_pFrontLayer->GetTile(x, y).m_Index == TILE_THROUGH_CUT) if(m_pEditor->m_Map.m_pFrontLayer && m_pEditor->m_Map.m_pFrontLayer->GetTile(x, y).m_Index == TILE_THROUGH_CUT)
{ {
CTile through_cut = {TILE_THROUGH_CUT}; CTile ThroughCut = {TILE_THROUGH_CUT};
return through_cut; return ThroughCut;
} }
else else
{ {
@ -38,8 +38,8 @@ void CLayerGame::SetTile(int x, int y, CTile Tile)
} }
CTile nohook = {TILE_NOHOOK}; CTile nohook = {TILE_NOHOOK};
CLayerTiles::SetTile(x, y, nohook); CLayerTiles::SetTile(x, y, nohook);
CTile through_cut = {TILE_THROUGH_CUT}; CTile ThroughCut = {TILE_THROUGH_CUT};
m_pEditor->m_Map.m_pFrontLayer->CLayerTiles::SetTile(x, y, through_cut); // NOLINT(bugprone-parent-virtual-call) m_pEditor->m_Map.m_pFrontLayer->CLayerTiles::SetTile(x, y, ThroughCut); // NOLINT(bugprone-parent-virtual-call)
} }
else else
{ {

View file

@ -290,13 +290,13 @@ void CCharacter::HandleNinja()
return; return;
// make sure we haven't Hit this object before // make sure we haven't Hit this object before
bool bAlreadyHit = false; bool AlreadyHit = false;
for(int j = 0; j < m_NumObjectsHit; j++) for(int j = 0; j < m_NumObjectsHit; j++)
{ {
if(m_apHitObjects[j] == pChr) if(m_apHitObjects[j] == pChr)
bAlreadyHit = true; AlreadyHit = true;
} }
if(bAlreadyHit) if(AlreadyHit)
continue; continue;
// check so we are sufficiently close // check so we are sufficiently close

View file

@ -32,8 +32,8 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
CPlayer *pPlayer = pChr->GetPlayer(); CPlayer *pPlayer = pChr->GetPlayer();
const int ClientId = pPlayer->GetCid(); const int ClientId = pPlayer->GetCid();
int m_TileIndex = GameServer()->Collision()->GetTileIndex(MapIndex); int TileIndex = GameServer()->Collision()->GetTileIndex(MapIndex);
int m_TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex); int TileFIndex = GameServer()->Collision()->GetFTileIndex(MapIndex);
//Sensitivity //Sensitivity
int S1 = GameServer()->Collision()->GetPureMapIndex(vec2(pChr->GetPos().x + pChr->GetProximityRadius() / 3.f, pChr->GetPos().y - pChr->GetProximityRadius() / 3.f)); int S1 = GameServer()->Collision()->GetPureMapIndex(vec2(pChr->GetPos().x + pChr->GetProximityRadius() / 3.f, pChr->GetPos().y - pChr->GetProximityRadius() / 3.f));
@ -50,7 +50,7 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
int FTile4 = GameServer()->Collision()->GetFTileIndex(S4); int FTile4 = GameServer()->Collision()->GetFTileIndex(S4);
const int PlayerDDRaceState = pChr->m_DDRaceState; const int PlayerDDRaceState = pChr->m_DDRaceState;
bool IsOnStartTile = (m_TileIndex == TILE_START) || (m_TileFIndex == TILE_START) || FTile1 == TILE_START || FTile2 == TILE_START || FTile3 == TILE_START || FTile4 == TILE_START || Tile1 == TILE_START || Tile2 == TILE_START || Tile3 == TILE_START || Tile4 == TILE_START; bool IsOnStartTile = (TileIndex == TILE_START) || (TileFIndex == TILE_START) || FTile1 == TILE_START || FTile2 == TILE_START || FTile3 == TILE_START || FTile4 == TILE_START || Tile1 == TILE_START || Tile2 == TILE_START || Tile3 == TILE_START || Tile4 == TILE_START;
// start // start
if(IsOnStartTile && PlayerDDRaceState != DDRACE_CHEAT) if(IsOnStartTile && PlayerDDRaceState != DDRACE_CHEAT)
{ {
@ -88,23 +88,23 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
} }
// finish // finish
if(((m_TileIndex == TILE_FINISH) || (m_TileFIndex == TILE_FINISH) || FTile1 == TILE_FINISH || FTile2 == TILE_FINISH || FTile3 == TILE_FINISH || FTile4 == TILE_FINISH || Tile1 == TILE_FINISH || Tile2 == TILE_FINISH || Tile3 == TILE_FINISH || Tile4 == TILE_FINISH) && PlayerDDRaceState == DDRACE_STARTED) if(((TileIndex == TILE_FINISH) || (TileFIndex == TILE_FINISH) || FTile1 == TILE_FINISH || FTile2 == TILE_FINISH || FTile3 == TILE_FINISH || FTile4 == TILE_FINISH || Tile1 == TILE_FINISH || Tile2 == TILE_FINISH || Tile3 == TILE_FINISH || Tile4 == TILE_FINISH) && PlayerDDRaceState == DDRACE_STARTED)
Teams().OnCharacterFinish(ClientId); Teams().OnCharacterFinish(ClientId);
// unlock team // unlock team
else if(((m_TileIndex == TILE_UNLOCK_TEAM) || (m_TileFIndex == TILE_UNLOCK_TEAM)) && Teams().TeamLocked(GameServer()->GetDDRaceTeam(ClientId))) else if(((TileIndex == TILE_UNLOCK_TEAM) || (TileFIndex == TILE_UNLOCK_TEAM)) && Teams().TeamLocked(GameServer()->GetDDRaceTeam(ClientId)))
{ {
Teams().SetTeamLock(GameServer()->GetDDRaceTeam(ClientId), false); Teams().SetTeamLock(GameServer()->GetDDRaceTeam(ClientId), false);
GameServer()->SendChatTeam(GameServer()->GetDDRaceTeam(ClientId), "Your team was unlocked by an unlock team tile"); GameServer()->SendChatTeam(GameServer()->GetDDRaceTeam(ClientId), "Your team was unlocked by an unlock team tile");
} }
// solo part // solo part
if(((m_TileIndex == TILE_SOLO_ENABLE) || (m_TileFIndex == TILE_SOLO_ENABLE)) && !Teams().m_Core.GetSolo(ClientId)) if(((TileIndex == TILE_SOLO_ENABLE) || (TileFIndex == TILE_SOLO_ENABLE)) && !Teams().m_Core.GetSolo(ClientId))
{ {
GameServer()->SendChatTarget(ClientId, "You are now in a solo part"); GameServer()->SendChatTarget(ClientId, "You are now in a solo part");
pChr->SetSolo(true); pChr->SetSolo(true);
} }
else if(((m_TileIndex == TILE_SOLO_DISABLE) || (m_TileFIndex == TILE_SOLO_DISABLE)) && Teams().m_Core.GetSolo(ClientId)) else if(((TileIndex == TILE_SOLO_DISABLE) || (TileFIndex == TILE_SOLO_DISABLE)) && Teams().m_Core.GetSolo(ClientId))
{ {
GameServer()->SendChatTarget(ClientId, "You are now out of the solo part"); GameServer()->SendChatTarget(ClientId, "You are now out of the solo part");
pChr->SetSolo(false); pChr->SetSolo(false);

View file

@ -119,8 +119,8 @@ void CTeeInfo::FromSixup()
} }
// find closest match // find closest match
int best_skin = 0; int BestSkin = 0;
int best_matches = -1; int BestMatches = -1;
for(int s = 0; s < 16; s++) for(int s = 0; s < 16; s++)
{ {
int matches = 0; int matches = 0;
@ -128,14 +128,14 @@ void CTeeInfo::FromSixup()
if(str_comp(m_apSkinPartNames[p], g_aStdSkins[s].m_apSkinPartNames[p]) == 0) if(str_comp(m_apSkinPartNames[p], g_aStdSkins[s].m_apSkinPartNames[p]) == 0)
matches++; matches++;
if(matches > best_matches) if(matches > BestMatches)
{ {
best_matches = matches; BestMatches = matches;
best_skin = s; BestSkin = s;
} }
} }
str_copy(m_aSkinName, g_aStdSkins[best_skin].m_aSkinName, sizeof(m_aSkinName)); str_copy(m_aSkinName, g_aStdSkins[BestSkin].m_aSkinName, sizeof(m_aSkinName));
m_UseCustomColor = true; m_UseCustomColor = true;
m_ColorBody = ColorHSLA(m_aUseCustomColors[0] ? m_aSkinPartColors[0] : 255).UnclampLighting(ms_DarkestLGT7).Pack(ColorHSLA::DARKEST_LGT); m_ColorBody = ColorHSLA(m_aUseCustomColors[0] ? m_aSkinPartColors[0] : 255).UnclampLighting(ms_DarkestLGT7).Pack(ColorHSLA::DARKEST_LGT);
m_ColorFeet = ColorHSLA(m_aUseCustomColors[4] ? m_aSkinPartColors[4] : 255).UnclampLighting(ms_DarkestLGT7).Pack(ColorHSLA::DARKEST_LGT); m_ColorFeet = ColorHSLA(m_aUseCustomColors[4] ? m_aSkinPartColors[4] : 255).UnclampLighting(ms_DarkestLGT7).Pack(ColorHSLA::DARKEST_LGT);