@@ -66,7 +66,7 @@ void CLuaTeamDefs::AddClass(lua_State* luaVM)
6666 lua_registerclass (luaVM, " Team" , " Element" );
6767}
6868
69- std::variant<CTeam*, bool > CLuaTeamDefs::CreateTeam (lua_State* lua, std::string name, std::uint8_t red, std::uint8_t green, std::uint8_t blue) noexcept
69+ std::variant<CTeam*, bool > CLuaTeamDefs::CreateTeam (lua_State* lua, const std::string_view name, const std::uint8_t red, const std::uint8_t green, const std::uint8_t blue) noexcept
7070{
7171 CLuaMain* vm = g_pGame->GetLuaManager ()->GetVirtualMachine (lua);
7272
@@ -78,7 +78,7 @@ std::variant<CTeam*, bool> CLuaTeamDefs::CreateTeam(lua_State* lua, std::string
7878 if (!resource)
7979 return false ;
8080
81- CTeam* team = CStaticFunctionDefinitions::CreateTeam (resource, name.c_str (), red, green, blue);
81+ CTeam* team = CStaticFunctionDefinitions::CreateTeam (resource, name.data (), red, green, blue);
8282
8383 if (!team)
8484 return false ;
@@ -91,9 +91,9 @@ std::variant<CTeam*, bool> CLuaTeamDefs::CreateTeam(lua_State* lua, std::string
9191 return team;
9292}
9393
94- std::variant<CTeam*, bool > CLuaTeamDefs::GetTeamFromName (const std::string name) noexcept
94+ std::variant<CTeam*, bool > CLuaTeamDefs::GetTeamFromName (const std::string_view name) noexcept
9595{
96- CTeam* team = m_pTeamManager->GetTeam (name.c_str ());
96+ CTeam* team = m_pTeamManager->GetTeam (name.data ());
9797
9898 if (!team)
9999 return false ;
@@ -137,17 +137,17 @@ bool CLuaTeamDefs::SetPlayerTeam(CPlayer* player, CTeam* team) noexcept
137137 return CStaticFunctionDefinitions::SetPlayerTeam (player, team);
138138}
139139
140- bool CLuaTeamDefs::SetTeamName (CTeam* team, std::string name) noexcept
140+ bool CLuaTeamDefs::SetTeamName (CTeam* team, const std::string_view name) noexcept
141141{
142- return CStaticFunctionDefinitions::SetTeamName (team, name.c_str ());
142+ return CStaticFunctionDefinitions::SetTeamName (team, name.data ());
143143}
144144
145- bool CLuaTeamDefs::SetTeamColor (CTeam* team, std::uint8_t red, std::uint8_t green, std::uint8_t blue) noexcept
145+ bool CLuaTeamDefs::SetTeamColor (CTeam* team, const std::uint8_t red, const std::uint8_t green, const std::uint8_t blue) noexcept
146146{
147147 return CStaticFunctionDefinitions::SetTeamColor (team, red, green, blue);
148148}
149149
150- bool CLuaTeamDefs::SetTeamFriendlyFire (CTeam* team, bool state) noexcept
150+ bool CLuaTeamDefs::SetTeamFriendlyFire (CTeam* team, const bool state) noexcept
151151{
152152 return CStaticFunctionDefinitions::SetTeamFriendlyFire (team, state);
153153}
0 commit comments