Skip to content

Commit

Permalink
Auto-assign fix: prioritize count when one team is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
geneotech committed Jun 26, 2024
1 parent aa82dc0 commit 9ab1eea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmake/web_shell.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="description" content="Free and open-source competitive 2D shooter on the Web.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://hypersomnia.io/">
<meta property="og:title" content="Hypersomnia">
<meta property="og:title" content="Hypersomnia.io">
<meta property="og:description" content="Free and open-source competitive 2D shooter on the Web.">
<meta property="og:image" content="https://raw.githubusercontent.com/TeamHypersomnia/PressKit/main/assets/logos/github_card.png">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
Expand Down
3 changes: 3 additions & 0 deletions src/augs/string/typesafe_sscanf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ TEST_CASE("TypesafeSscanf", "TypesafeSscanfSeveralTests") {
REQUIRE(3 == id);
REQUIRE(2 == test_scanf("[US] arena-us.hypersomnia.xyz #1", "%x#%x", rest, id));
REQUIRE(1 == id);

REQUIRE(2 == test_scanf("[CH] Switzerland #8 R", "%x#%x", rest, id));
REQUIRE(8 == id);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/game/modes/arena_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ faction_type arena_mode::calc_weakest_faction(const const_input_type in) const {
std::size_t count;

bool operator<(const weak_faction& b) const {
if (score == b.score) {
if (score == b.score || count == 0 || b.count == 0) {
return count < b.count;
}

Expand Down
2 changes: 2 additions & 0 deletions src/work.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,8 @@ work_result work(
(void)change_with_save;

#if PLATFORM_WEB
LOG_NVPS(config.client.nickname);

if (config.client.nickname.empty() || config.client.nickname == "web_user") {
const auto rng_name = ::make_random_nickname(netcode_rng);
const auto final_nickname =
Expand Down

0 comments on commit 9ab1eea

Please sign in to comment.