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
1e474bef
Commit
1e474bef
authored
Apr 22, 2015
by
Zach
Browse files
Merge pull request #1009 from poixen/p_t_fix
Fix for #1007
parents
82d8c724
1356bbcd
Changes
1
Show whitespace changes
Inline
Side-by-side
common/server_card.cpp
View file @
1e474bef
...
...
@@ -23,7 +23,7 @@
#include
"pb/serverinfo_card.pb.h"
Server_Card
::
Server_Card
(
QString
_name
,
int
_id
,
int
_coord_x
,
int
_coord_y
,
Server_CardZone
*
_zone
)
:
zone
(
_zone
),
id
(
_id
),
coord_x
(
_coord_x
),
coord_y
(
_coord_y
),
name
(
_name
),
tapped
(
false
),
attacking
(
false
),
facedown
(
false
),
color
(
QString
()),
power
(
-
1
),
toughness
(
-
1
),
annotation
(
QString
()),
destroyOnZoneChange
(
false
),
doesntUntap
(
false
),
parentCard
(
0
)
:
zone
(
_zone
),
id
(
_id
),
coord_x
(
_coord_x
),
coord_y
(
_coord_y
),
name
(
_name
),
tapped
(
false
),
attacking
(
false
),
facedown
(
false
),
color
(
QString
()),
power
(
0
),
toughness
(
0
),
annotation
(
QString
()),
destroyOnZoneChange
(
false
),
doesntUntap
(
false
),
parentCard
(
0
)
{
}
...
...
@@ -42,8 +42,8 @@ void Server_Card::resetState()
counters
.
clear
();
setTapped
(
false
);
setAttacking
(
false
);
power
=
-
1
;
toughness
=
-
1
;
power
=
0
;
toughness
=
0
;
setAnnotation
(
QString
());
setDoesntUntap
(
false
);
}
...
...
@@ -86,14 +86,16 @@ void Server_Card::setPT(const QString &_pt)
QString
p2
=
_pt
.
mid
(
sep
+
1
);
if
(
p1
.
isEmpty
()
||
p2
.
isEmpty
())
return
;
if
((
p1
[
0
]
==
'+'
)
||
(
p2
[
0
]
==
'+'
))
{
if
((
p1
[
0
]
==
'+'
)
||
(
p2
[
0
]
==
'+'
))
if
(
toughness
<
0
)
toughness
=
0
;
}
if
(
p1
[
0
]
==
'+'
)
power
+=
p1
.
mid
(
1
).
toInt
();
else
power
=
p1
.
toInt
();
if
(
p2
[
0
]
==
'+'
)
toughness
+=
p2
.
mid
(
1
).
toInt
();
else
...
...
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