reset card p/t when empty string is sent

This commit is contained in:
Max-Wilhelm Bruker 2011-03-12 20:43:12 +01:00
parent 480d2730c6
commit be7779a466

View file

@ -80,6 +80,10 @@ void Server_Card::setCounter(int id, int value)
void Server_Card::setPT(const QString &_pt)
{
if (_pt.isEmpty()) {
power = 0;
toughness = -1;
} else {
int sep = _pt.indexOf('/');
QString p1 = _pt.left(sep);
QString p2 = _pt.mid(sep + 1);
@ -99,6 +103,7 @@ void Server_Card::setPT(const QString &_pt)
toughness += p2.mid(1).toInt();
else
toughness = p2.toInt();
}
}
QString Server_Card::getPT() const