Skip to content

Commit 3f217b0

Browse files
committed
More bug fixes for kart queue + AI choose standard karts only on the server
Addons were pickable even when explicitly forbidden by filter, because apparently I need to call kart filter twice anyway. Happily it's quite beautiful, as one of cases is the exact inverse of the order of another case.
1 parent a582102 commit 3f217b0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/network/protocols/server_lobby.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8271,7 +8271,7 @@ bool ServerLobby::areKartFiltersIgnoringKarts() const
82718271
//-----------------------------------------------------------------------------
82728272
std::string ServerLobby::getKartForBadKartChoice(STKPeer* peer, const std::string& username, const std::string& check_choice) const
82738273
{
8274-
std::set<std::string> karts = peer->getClientAssets().first;
8274+
std::set<std::string> karts = (peer->isAIPeer() ? m_available_kts.first : peer->getClientAssets().first);
82758275
applyAllKartFilters(username, karts, true);
82768276
if (m_kart_elimination.isEliminated(username)
82778277
&& karts.count(m_kart_elimination.getKart()))

src/utils/track_filter.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,6 @@ void KartFilter::apply(FilterContext& context) const
420420
// return;
421421
// }
422422

423-
424-
if (!m_ignore_players_input && !context.applied_at_selection_start)
425-
return;
426-
427423
// Ignoring means that the random of allowed and randoms will be picked afterwards
428424
// Not ignoring means that the player chooses from allowed
429425
// and one instance of each random
@@ -489,7 +485,8 @@ void KartFilter::apply(FilterContext& context) const
489485
result.insert(s);
490486
}
491487
}
492-
else if (m_ignore_players_input && context.applied_at_selection_start)
488+
else if ((m_ignore_players_input && context.applied_at_selection_start)
489+
|| (!m_ignore_players_input && !context.applied_at_selection_start))
493490
{
494491
for (const auto& array: m_random_stuff)
495492
{

0 commit comments

Comments
 (0)