diff options
author | Freeyorp <Freeyorp101@hotmail.com> | 2009-12-19 20:12:06 +1300 |
---|---|---|
committer | Freeyorp <Freeyorp101@hotmail.com> | 2009-12-19 20:12:06 +1300 |
commit | 2968691478f6479e98377ca500a0da69bc0f392a (patch) | |
tree | db22141937b53751369ccf83eee1226c9960a96c /src/gui/statuswindow.cpp | |
parent | 6ad0ab8123de1ee3f27ad38300dc7ef896bab569 (diff) | |
download | mana-2968691478f6479e98377ca500a0da69bc0f392a.tar.gz mana-2968691478f6479e98377ca500a0da69bc0f392a.tar.bz2 mana-2968691478f6479e98377ca500a0da69bc0f392a.tar.xz mana-2968691478f6479e98377ca500a0da69bc0f392a.zip |
Fix a race condition
If the server tells the client to update the mp bar when handling an matk
change message before the status window has initialised, a segfault
occurs
Diffstat (limited to 'src/gui/statuswindow.cpp')
-rw-r--r-- | src/gui/statuswindow.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 94c95f68..4db8c751 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -112,7 +112,9 @@ StatusWindow::StatusWindow(): mMpLabel = new Label(_("MP:")); mMpBar = new ProgressBar((float) player_node->getMaxMP() / (float) player_node->getMaxMP(), - 80, 15, gcn::Color(26, 102, 230)); + 80, 15, Net::getPlayerHandler()->canUseMagic() ? + gcn::Color(26, 102, 230) : + gcn::Color(100, 100, 100)); place(0, 0, mLvlLabel, 3); // 5, 0 Job Level |