Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
c675cf40
Commit
c675cf40
authored
Jul 25, 2015
by
Zach
Browse files
Merge pull request #1272 from Fizztastic/fix_577
Joining a full game joins you as spectator
parents
903292ad
3f220242
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/gameselector.cpp
View file @
c675cf40
...
@@ -157,12 +157,11 @@ void GameSelector::checkResponse(const Response &response)
...
@@ -157,12 +157,11 @@ void GameSelector::checkResponse(const Response &response)
void
GameSelector
::
actJoin
()
void
GameSelector
::
actJoin
()
{
{
bool
spectator
=
sender
()
==
spectateButton
;
QModelIndex
ind
=
gameListView
->
currentIndex
();
QModelIndex
ind
=
gameListView
->
currentIndex
();
if
(
!
ind
.
isValid
())
if
(
!
ind
.
isValid
())
return
;
return
;
const
ServerInfo_Game
&
game
=
gameListModel
->
getGame
(
ind
.
data
(
Qt
::
UserRole
).
toInt
());
const
ServerInfo_Game
&
game
=
gameListModel
->
getGame
(
ind
.
data
(
Qt
::
UserRole
).
toInt
());
bool
spectator
=
sender
()
==
spectateButton
||
game
.
player_count
()
==
game
.
max_players
();
bool
overrideRestrictions
=
!
tabSupervisor
->
getAdminLocked
();
bool
overrideRestrictions
=
!
tabSupervisor
->
getAdminLocked
();
QString
password
;
QString
password
;
if
(
game
.
with_password
()
&&
!
(
spectator
&&
!
game
.
spectators_need_password
())
&&
!
overrideRestrictions
)
{
if
(
game
.
with_password
()
&&
!
(
spectator
&&
!
game
.
spectators_need_password
())
&&
!
overrideRestrictions
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment