Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Games
KsirK
Commits
777107cb
Commit
777107cb
authored
Jul 18, 2010
by
Gaël de Chalendar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrects bug #243624
svn path=/trunk/KDE/kdegames/ksirk/; revision=1151240
parent
553e0eb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
3 deletions
+30
-3
ksirk/GameLogic/goal.cpp
ksirk/GameLogic/goal.cpp
+26
-2
ksirk/kgamewin.cpp
ksirk/kgamewin.cpp
+4
-1
No files found.
ksirk/GameLogic/goal.cpp
View file @
777107cb
...
...
@@ -80,10 +80,26 @@ Goal::~Goal()
bool
Goal
::
checkFor
(
const
GameLogic
::
Player
*
player
)
const
{
kDebug
()
<<
message
(
GoalAdvance
);
int
diff
=
0
;
switch
(
type
())
{
case
Goal
::
GoalPlayer
:
kDebug
()
<<
"Goal reached checked elsewhere for Player type"
<<
endl
;
if
(
m_automaton
->
playerNamed
(
*
m_players
.
begin
())
!=
0
)
{
return
false
;
}
else
{
diff
=
m_nbCountries
-
m_player
->
countries
().
size
();
if
(
diff
>
0
)
{
return
false
;
}
else
{
return
true
;
}
}
return
false
;
break
;
case
Goal
::
Countries
:
...
...
@@ -235,7 +251,15 @@ QString Goal::message(int displayType) const
}
else
{
mes
+=
i18n
(
"<br>You now have to conquer %1"
,
m_nbCountries
);
diff
=
m_nbCountries
-
m_player
->
countries
().
size
();
if
(
diff
>
0
)
{
mes
+=
i18np
(
"<br>%2, you still have 1 country to conquer..."
,
"<br>%2, you still have %1 countries to conquer..."
,
diff
,
m_player
->
name
());
}
else
{
mes
+=
i18n
(
"<br>Your goal is reached: %1 is dead and you possess %2 countries."
,
*
m_players
.
begin
(),
m_nbCountries
);
}
}
break
;
case
Goal
::
Countries
:
...
...
ksirk/kgamewin.cpp
View file @
777107cb
...
...
@@ -845,7 +845,10 @@ bool KGameWindow::attackEnd()
}
else
if
(
m_automaton
->
isAdmin
())
{
m_automaton
->
checkGoal
();
foreach
(
KPlayer
*
player
,
*
m_automaton
->
playerList
())
{
m_automaton
->
checkGoal
((
Player
*
)
player
);
}
}
}
else
if
(
m_automaton
->
isAdmin
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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