summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/gui/guildwindow.cpp17
-rw-r--r--src/gui/widgets/tabbedarea.cpp1
3 files changed, 20 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e91723d..eff8c85b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,7 +15,11 @@
* src/localplayer.h, src/localplayer.cpp, src/gui/viewport.cpp,
src/main.h, src/main.cpp: Added input type parameter to the
LocalPlayer::SetDestination methods in order to keep control over
- message flooding to the server with mouse dragging.
+ message flooding to the server with mouse dragging. Moved Mouse calls
+ flooding control into viewport to avoid calling setDestination
+ unecessarily.
+ * Fixed a crash when clicking on 'Quit Guild' Button. Also disabled
+ the 'Invite user' and 'Quit Guild' buttons when no Guild is created.
2008-04-16 David Athay <ko2fan@gmail.com>
diff --git a/src/gui/guildwindow.cpp b/src/gui/guildwindow.cpp
index 0e9a066a..2a4de773 100644
--- a/src/gui/guildwindow.cpp
+++ b/src/gui/guildwindow.cpp
@@ -85,6 +85,12 @@ GuildWindow::~GuildWindow()
void GuildWindow::update()
{
updateTab();
+
+ if (mGuildButton[2]->isEnabled()&& mGuildTabs->getNumberOfTabs() <= 0)
+ {
+ mGuildButton[2]->setEnabled(false);
+ mGuildButton[1]->setEnabled(false);
+ }
}
void GuildWindow::draw(gcn::Graphics *g)
@@ -217,10 +223,15 @@ bool GuildWindow::isFocused()
short GuildWindow::getSelectedGuild()
{
- Guild *guild = player_node->getGuild(mGuildTabs->getSelectedTab()->getCaption());
- if (guild)
+ if (mGuildTabs->getNumberOfTabs() > 0)
{
- return guild->getId();
+
+ Guild *guild = player_node->getGuild(mGuildTabs->getSelectedTab()->getCaption());
+
+ if (guild)
+ {
+ return guild->getId();
+ }
}
return 0;
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index a22c795c..9087babc 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -47,6 +47,7 @@ gcn::Tab* TabbedArea::getTab(const std::string &name)
}
++itr;
}
+ return NULL;
}
void TabbedArea::draw(gcn::Graphics *graphics)