Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions libs/s25main/desktops/dskGameLobby.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ dskGameLobby::dskGameLobby(ServerType serverType, std::shared_ptr<GameLobby> gam
// Karte laden, um Kartenvorschau anzuzeigen
if(!gameLobby_->isSavegame())
{
bool isMapPreviewEnabled = !lua || lua->IsMapPreviewEnabled();
const bool isMapPreviewEnabled = !lua || lua->IsMapPreviewEnabled();
if(!isMapPreviewEnabled)
{
AddTextDeepening(70, DrawPoint(560, 40), Extent(220, 220), TextureColor::Grey, _("No preview"), LargeFont,
Expand Down Expand Up @@ -685,13 +685,16 @@ void dskGameLobby::Msg_ButtonClick(const unsigned ctrl_id)
else
{
std::unique_ptr<iwAddons> w;
if(allowAddonChange && lua->IsChangeAllowed("addonsAll"))
if(!allowAddonChange)
w = std::make_unique<iwAddons>(gameLobby_->getSettings(), this, AddonChangeAllowed::None);
else if(IsChangeAllowed("addonsAll"))
w = std::make_unique<iwAddons>(gameLobby_->getSettings(), this, AddonChangeAllowed::All);
else if(allowAddonChange)
else
{
RTTR_Assert(lua); // Otherwise all changes would be allowed
w = std::make_unique<iwAddons>(gameLobby_->getSettings(), this, AddonChangeAllowed::WhitelistOnly,
lua->GetAllowedAddons());
else
w = std::make_unique<iwAddons>(gameLobby_->getSettings(), this, AddonChangeAllowed::None);
}
WINDOWMANAGER.Show(std::move(w));
}
}
Expand Down Expand Up @@ -960,7 +963,6 @@ void dskGameLobby::SetPlayerReady(unsigned char player, bool ready)

void dskGameLobby::CI_NewPlayer(const unsigned playerId)
{
// Spielername setzen
UpdatePlayerRow(playerId);

if(lua && gameLobby_->isHost())
Expand All @@ -976,7 +978,6 @@ void dskGameLobby::CI_PlayerLeft(const unsigned playerId)

void dskGameLobby::CI_GameLoading(std::shared_ptr<Game> game)
{
// Desktop wechseln
WINDOWMANAGER.Switch(std::make_unique<dskGameLoader>(std::move(game)));
}

Expand Down
Loading