Skip to content

Commit

Permalink
Make suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico8340 committed Jan 10, 2025
1 parent b1c3020 commit 9cf287a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Client/mods/deathmatch/logic/luadefs/CLuaTeamDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ void CLuaTeamDefs::AddClass(lua_State* luaVM)

std::variant<CClientTeam*, bool> CLuaTeamDefs::GetTeamFromName(const std::string_view name) noexcept
{
CClientTeam* team = m_pTeamManager->GetTeam(name.data());
std::string string(name);
CClientTeam* team = m_pTeamManager->GetTeam(string.c_str());

if (!team)
return false;

return team;
}

std::string CLuaTeamDefs::GetTeamName(CClientTeam* team) noexcept
std::string CLuaTeamDefs::GetTeamName(CClientTeam* team)
{
return std::string(team->GetTeamName());
}
Expand All @@ -76,7 +77,7 @@ bool CLuaTeamDefs::GetTeamFriendlyFire(CClientTeam* team) noexcept
return team->GetFriendlyFire();
}

std::vector<CClientPlayer*> CLuaTeamDefs::GetPlayersInTeam(CClientTeam* team) noexcept
std::vector<CClientPlayer*> CLuaTeamDefs::GetPlayersInTeam(CClientTeam* team)
{
return team->GetPlayers();
}
Expand Down
4 changes: 2 additions & 2 deletions Client/mods/deathmatch/logic/luadefs/CLuaTeamDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class CLuaTeamDefs : public CLuaDefs

private:
static std::variant<CClientTeam*, bool> GetTeamFromName(const std::string_view name) noexcept;
static std::string GetTeamName(CClientTeam* team) noexcept;
static std::string GetTeamName(CClientTeam* team);
static CLuaMultiReturn<std::uint8_t, std::uint8_t, std::uint8_t> GetTeamColor(CClientTeam* team) noexcept;
static bool GetTeamFriendlyFire(CClientTeam* team) noexcept;
static std::vector<CClientPlayer*> GetPlayersInTeam(CClientTeam* team) noexcept;
static std::vector<CClientPlayer*> GetPlayersInTeam(CClientTeam* team);
static std::uint32_t CountPlayersInTeam(CClientTeam* team) noexcept;
};

0 comments on commit 9cf287a

Please sign in to comment.