From 3e19fee64d4b65bd6490154588786d2111c8985a Mon Sep 17 00:00:00 2001 From: Chiller Dragon Date: Fri, 4 Jan 2019 22:07:35 +0100 Subject: [PATCH 1/2] Remove space xd --- bam.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bam.lua b/bam.lua index 09dd365f2..a6c63c5be 100644 --- a/bam.lua +++ b/bam.lua @@ -120,7 +120,7 @@ function GenerateMacOSXSettings(settings, conf, arch, compiler) os.exit(1) end - -- c++ stdlib needed + -- c++ stdlib needed settings.cc.flags:Add("--stdlib=libc++") settings.link.flags:Add("--stdlib=libc++") -- this also needs the macOS min SDK version to be at least 10.7 From 22289be1b9f678ff3c1d41338441a3da770d1e09 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sat, 5 Jan 2019 17:57:18 +0100 Subject: [PATCH 2/2] Remove spaces at end of line (thanks to @nheir) --- datasrc/editor/desert_main.rules | 4 ++-- datasrc/editor/jungle_main.rules | 4 ++-- other/teeworlds.appdata.xml | 2 +- scripts/refactor_count.py | 4 ++-- src/base/system.c | 2 +- src/base/system.h | 2 +- src/engine/client/serverbrowser.h | 2 +- src/engine/client/serverbrowser_fav.cpp | 2 +- src/engine/shared/network_token.cpp | 2 +- src/game/client/components/binds.cpp | 2 +- src/game/client/components/menus_browser.cpp | 6 +++--- src/game/client/components/menus_ingame.cpp | 2 +- src/game/client/components/scoreboard.h | 2 +- src/game/server/gamemodes/lms.cpp | 4 ++-- src/game/server/gamemodes/lts.cpp | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) diff --git a/datasrc/editor/desert_main.rules b/datasrc/editor/desert_main.rules index 0102a1973..b212c8a56 100644 --- a/datasrc/editor/desert_main.rules +++ b/datasrc/editor/desert_main.rules @@ -21,7 +21,7 @@ Random 150 Index 16 Pos 0 -1 EMPTY -#right +#right Index 17 Pos 1 0 EMPTY @@ -170,7 +170,7 @@ Random 500 Index 96 Pos 0 -1 EMPTY -#right +#right Index 97 Pos 1 0 EMPTY diff --git a/datasrc/editor/jungle_main.rules b/datasrc/editor/jungle_main.rules index ada1f3ac4..3677bdde6 100644 --- a/datasrc/editor/jungle_main.rules +++ b/datasrc/editor/jungle_main.rules @@ -33,7 +33,7 @@ Index 98 Pos 0 -1 EMPTY Random 15 -#right +#right Index 21 Pos 1 0 EMPTY @@ -209,7 +209,7 @@ Random 150 Index 26 Pos 0 -1 EMPTY -#right +#right Index 25 Pos 1 0 EMPTY diff --git a/other/teeworlds.appdata.xml b/other/teeworlds.appdata.xml index 3d05dbb47..c5ab8cd64 100644 --- a/other/teeworlds.appdata.xml +++ b/other/teeworlds.appdata.xml @@ -8,7 +8,7 @@

Teeworlds is a free online multiplayer game. Battle with up to 16 players in a variety of game modes, including Team Deathmatch and Capture The Flag. - You can even design your own maps! + You can even design your own maps!

https://www.teeworlds.com/ diff --git a/scripts/refactor_count.py b/scripts/refactor_count.py index 8fdec46e9..7e847e86d 100644 --- a/scripts/refactor_count.py +++ b/scripts/refactor_count.py @@ -31,10 +31,10 @@ allowed_words += [ # system.h "str_comp_num", "str_find_nocase", "str_sanitize_strong", "str_uppercase", "str_toint", "str_tofloat", "str_utf8_encode", "str_utf8_rewind", "str_utf8_forward", "str_utf8_decode", "str_sanitize_cc", "str_skip_whitespaces", "fs_makedir", "fs_listdir", "fs_storage_path", "fs_is_dir", - "net_init", "net_addr_comp", "net_host_lookup", "net_addr_str", "type", "port", "net_addr_from_str", + "net_init", "net_addr_comp", "net_host_lookup", "net_addr_str", "type", "port", "net_addr_from_str", "net_udp_create", "net_udp_send", "net_udp_recv", "net_udp_close", "net_socket_read_wait", "net_stats", "sent_bytes", "recv_bytes", "recv_packets", "sent_packets", - "time_get", "time_freq", "time_timestamp"] + "time_get", "time_freq", "time_timestamp"] allowed_words += ["vec2", "vec3", "vec4", "round", "clamp", "length", "dot", "normalize", "frandom", "mix", "distance", "min", "closest_point_on_line", "max", "absolute"] # math.hpp diff --git a/src/base/system.c b/src/base/system.c index b9b334809..1a3c18e29 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -1817,7 +1817,7 @@ char* str_sanitize_filename(char* aName) while(*str) { // replace forbidden characters with a whispace - if(*str == '/' || *str == '<' || *str == '>' || *str == ':' || *str == '"' + if(*str == '/' || *str == '<' || *str == '>' || *str == ':' || *str == '"' || *str == '/' || *str == '\\' || *str == '|' || *str == '?' || *str == '*') *str = ' '; str++; diff --git a/src/base/system.h b/src/base/system.h index 32ec8e710..40cea6cfe 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -849,7 +849,7 @@ void str_sanitize(char *str); /* Function: str_sanitize_filename - Replaces all forbidden Windows/Unix characters with whitespace + Replaces all forbidden Windows/Unix characters with whitespace or nothing if leading or trailing. Parameters: diff --git a/src/engine/client/serverbrowser.h b/src/engine/client/serverbrowser.h index 80ce06f3f..d32d5f3fa 100644 --- a/src/engine/client/serverbrowser.h +++ b/src/engine/client/serverbrowser.h @@ -45,7 +45,7 @@ public: void RemoveFavorite(const CServerInfo *pEntry); int AddFilter(const CServerFilterInfo *pFilterInfo) { return m_ServerBrowserFilter.AddFilter(pFilterInfo); }; - void SetFilter(int Index, const CServerFilterInfo *pFilterInfo) { m_ServerBrowserFilter.SetFilter(Index, pFilterInfo); }; + void SetFilter(int Index, const CServerFilterInfo *pFilterInfo) { m_ServerBrowserFilter.SetFilter(Index, pFilterInfo); }; void GetFilter(int Index, CServerFilterInfo *pFilterInfo) { m_ServerBrowserFilter.GetFilter(Index, pFilterInfo); }; void RemoveFilter(int Index) { m_ServerBrowserFilter.RemoveFilter(Index); }; diff --git a/src/engine/client/serverbrowser_fav.cpp b/src/engine/client/serverbrowser_fav.cpp index 06aff056a..962caedde 100644 --- a/src/engine/client/serverbrowser_fav.cpp +++ b/src/engine/client/serverbrowser_fav.cpp @@ -139,7 +139,7 @@ bool CServerBrowserFavorites::RemoveFavoriteEx(const char *pHostname, const NETA } else if(pFavEntry->m_State <= FAVSTATE_LOOKUPCHECK && m_FavLookup.m_FavoriteIndex == Index) { - // skip result on favorite hostname lookup + // skip result on favorite hostname lookup m_FavLookup.m_FavoriteIndex = -1; } diff --git a/src/engine/shared/network_token.cpp b/src/engine/shared/network_token.cpp index 9896d5d9e..bbed8a1ac 100644 --- a/src/engine/shared/network_token.cpp +++ b/src/engine/shared/network_token.cpp @@ -254,7 +254,7 @@ TOKEN CNetTokenCache::GetToken(const NETADDR *pAddr) void CNetTokenCache::FetchToken(const NETADDR *pAddr) { - CNetBase::SendControlMsgWithToken(m_Socket, pAddr, NET_TOKEN_NONE, 0, + CNetBase::SendControlMsgWithToken(m_Socket, pAddr, NET_TOKEN_NONE, 0, NET_CTRLMSG_TOKEN, m_pTokenManager->GenerateToken(pAddr), true); } diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index 3ec544442..3ac20aba3 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -57,7 +57,7 @@ int CBinds::GetModifierMask(IInput *i) Mask |= i->KeyIsPressed(KEY_LCTRL) << CBinds::MODIFIER_CTRL; Mask |= i->KeyIsPressed(KEY_RCTRL) << CBinds::MODIFIER_CTRL; Mask |= i->KeyIsPressed(KEY_LALT) << CBinds::MODIFIER_ALT; - if(Mask == 0) + if(Mask == 0) return 1; // if no modifier, flag with MODIFIER_NONE return Mask; } diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index ba7a6c6b6..0e8c5a343 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -257,7 +257,7 @@ void CMenus::SaveFilters() if(i == 0) p = "\n"; else - p = ",\n"; + p = ",\n"; io_write(File, p, str_length(p)); str_format(aBuf, sizeof(aBuf), "\t{\"%s\": {\n", m_lFilters[i].Name()); @@ -1032,7 +1032,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) int NumFilters = m_lFilters.size(); float ListHeight = NumServers * ms_ListheaderHeight; // add server list height - ListHeight += NumFilters * SpacingH; // add filters + ListHeight += NumFilters * SpacingH; // add filters ListHeight += (NumFilters) * ButtonHeight;// add filters spacing if(!m_SidebarActive && m_SelectedServer.m_Index != -1 && SelectedFilter != -1 && m_ShowServerDetails) ListHeight += ms_ListheaderHeight*5; @@ -1841,7 +1841,7 @@ void CMenus::RenderDetailInfo(CUIRect View, const CServerInfo *pInfo) if(pInfo) { CUIRect Row; - // Localize("Map"); Localize("Game type"); Localize("Version"); Localize("Casual"); Localize("Normal"); Localize("Difficulty"); Localize("Competitive"); + // Localize("Map"); Localize("Game type"); Localize("Version"); Localize("Casual"); Localize("Normal"); Localize("Difficulty"); Localize("Competitive"); static CLocConstString s_aLabels[] = { "Map", "Game type", diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index 455cc3450..a91e90e55 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -437,7 +437,7 @@ void CMenus::RenderServerInfo(CUIRect MainView) GameInfo.HSplitTop(ButtonHeight, &Label, &GameInfo); Label.y += 2.0f; - str_format(aBuf, sizeof(aBuf), "%s: %s", Localize("Difficulty"), (CurrentServerInfo.m_ServerLevel == 0) ? Localize("Casual") : + str_format(aBuf, sizeof(aBuf), "%s: %s", Localize("Difficulty"), (CurrentServerInfo.m_ServerLevel == 0) ? Localize("Casual") : (CurrentServerInfo.m_ServerLevel == 1 ? Localize("Normal") : Localize("Competitive"))); UI()->DoLabel(&Label, aBuf, ButtonHeight*ms_FontmodHeight*0.8f, CUI::ALIGN_LEFT); diff --git a/src/game/client/components/scoreboard.h b/src/game/client/components/scoreboard.h index 109b8d047..5ca8fd139 100644 --- a/src/game/client/components/scoreboard.h +++ b/src/game/client/components/scoreboard.h @@ -39,7 +39,7 @@ public: bool Active(); void ResetPlayerStats(int ClientID); - class CUIRect GetScoreboardRect(); + class CUIRect GetScoreboardRect(); }; #endif diff --git a/src/game/server/gamemodes/lms.cpp b/src/game/server/gamemodes/lms.cpp index 4675f8857..d81d77ed1 100644 --- a/src/game/server/gamemodes/lms.cpp +++ b/src/game/server/gamemodes/lms.cpp @@ -36,7 +36,7 @@ void CGameControllerLMS::DoWincheckRound() for(int i = 0; i < MAX_CLIENTS; ++i) { if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS && - (!GameServer()->m_apPlayers[i]->m_RespawnDisabled || + (!GameServer()->m_apPlayers[i]->m_RespawnDisabled || (GameServer()->m_apPlayers[i]->GetCharacter() && GameServer()->m_apPlayers[i]->GetCharacter()->IsAlive()))) GameServer()->m_apPlayers[i]->m_Score++; } @@ -51,7 +51,7 @@ void CGameControllerLMS::DoWincheckRound() for(int i = 0; i < MAX_CLIENTS; ++i) { if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS && - (!GameServer()->m_apPlayers[i]->m_RespawnDisabled || + (!GameServer()->m_apPlayers[i]->m_RespawnDisabled || (GameServer()->m_apPlayers[i]->GetCharacter() && GameServer()->m_apPlayers[i]->GetCharacter()->IsAlive()))) { ++AlivePlayerCount; diff --git a/src/game/server/gamemodes/lts.cpp b/src/game/server/gamemodes/lts.cpp index 2336dae9b..a4a4472e1 100644 --- a/src/game/server/gamemodes/lts.cpp +++ b/src/game/server/gamemodes/lts.cpp @@ -20,7 +20,7 @@ void CGameControllerLTS::DoWincheckRound() for(int i = 0; i < MAX_CLIENTS; ++i) { if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS && - (!GameServer()->m_apPlayers[i]->m_RespawnDisabled || + (!GameServer()->m_apPlayers[i]->m_RespawnDisabled || (GameServer()->m_apPlayers[i]->GetCharacter() && GameServer()->m_apPlayers[i]->GetCharacter()->IsAlive()))) ++Count[GameServer()->m_apPlayers[i]->GetTeam()]; }