summaryrefslogtreecommitdiffstats
path: root/sigmodr/widgets/MoveUI.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-02-28 00:42:51 -0500
committerBen Boeckel <MathStuf@gmail.com>2009-02-28 00:42:51 -0500
commitcd45e52962766099140320806e4e6ac5bb2f8383 (patch)
treee6d738ba888a6c5d23dbb9aa05cbce695f63bf59 /sigmodr/widgets/MoveUI.cpp
parent3655fc2210bcfaa02950754b57b52865b8d74071 (diff)
Protected combobox changes to avoid calls on error states
Diffstat (limited to 'sigmodr/widgets/MoveUI.cpp')
-rw-r--r--sigmodr/widgets/MoveUI.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/sigmodr/widgets/MoveUI.cpp b/sigmodr/widgets/MoveUI.cpp
index 2bcdc4d4..9a9c09dd 100644
--- a/sigmodr/widgets/MoveUI.cpp
+++ b/sigmodr/widgets/MoveUI.cpp
@@ -143,7 +143,8 @@ void MoveUI::powerChanged(const int power)
void MoveUI::typeChanged(const int type)
{
- qobject_cast<Move*>(modified())->setType(game()->type(type)->id());
+ if (0 <= type)
+ qobject_cast<Move*>(modified())->setType(game()->type(type)->id());
}
void MoveUI::powerPointsChanged(const int powerPoints)