Skip to content

Commit

Permalink
Lua: added side.choose_random getter (fixes #2378)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Feb 8, 2018
1 parent 13a4822 commit 3de5ee8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/scripting/lua_team.cpp
Expand Up @@ -86,6 +86,7 @@ static int impl_side_get(lua_State *L)
return_string_attrib("share_vision", t.share_vision().to_string());
return_bool_attrib("share_maps", t.share_maps());
return_bool_attrib("share_view", t.share_view());
return_bool_attrib("chose_random", t.chose_random());

if (strcmp(m, "recruit") == 0) {
const std::set<std::string>& recruits = t.recruits();
Expand Down
6 changes: 6 additions & 0 deletions src/team.hpp
Expand Up @@ -398,6 +398,12 @@ class team
info_.handle_legacy_share_vision(cfg);
}
std::string allied_human_teams() const;

bool chose_random() const
{
return info_.chose_random;
}

private:

const std::vector<const shroud_map*>& ally_shroud(const std::vector<team>& teams) const;
Expand Down

1 comment on commit 3de5ee8

@Vultraz
Copy link
Member Author

@Vultraz Vultraz commented on 3de5ee8 Feb 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, commit message should have said chose_random. Oh well.

Please sign in to comment.