Skip to content

Commit

Permalink
Make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nico8340 committed Jan 10, 2025
1 parent 867aee1 commit c0720ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Client/mods/deathmatch/logic/luadefs/CLuaTeamDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ void CLuaTeamDefs::AddClass(lua_State* luaVM)
lua_registerclass(luaVM, "Team", "Element");
}

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

if (!team)
return false;

return team;
}

std::string CLuaTeamDefs::GetTeamName(CClientTeam* team) noexcept
Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/luadefs/CLuaTeamDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CLuaTeamDefs : public CLuaDefs
static void AddClass(lua_State* luaVM);

private:
static CClientTeam* GetTeamFromName(const std::string name) noexcept;
static std::variant<CClientTeam*, bool> GetTeamFromName(const std::string name) noexcept;
static std::string GetTeamName(CClientTeam* team) noexcept;
static CLuaMultiReturn<std::uint8_t, std::uint8_t, std::uint8_t> GetTeamColor(CClientTeam* team) noexcept;
static bool GetTeamFriendlyFire(CClientTeam* team) noexcept;
Expand Down

0 comments on commit c0720ae

Please sign in to comment.