From 5cf18a062ffca03196b83fe6fda8ea3e54079c57 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Sun, 2 Nov 2008 00:33:31 +0000 Subject: Ported a patch from TMW by fate which de-hardcodes skills, as well as removes the server sending out view id's for gloves and boots (which weren't needed.) Here's the full log: * Updated GUI table and model to better handle NULL widgets during initialisation * On SMSG_MOVE et al., ignore boots and glove information-- that information is incorrect and we're guaranteed to already have the correct information anyway. * Properly decode `is dead' information for PCs, so that dead players, when encountered, will be lying on the ground, dead, rather than standing. * Use `skills.xml' file from client data to determine skill names * Report client version number (hereby bumped to 1) in unused charserver slot (ignored by vanilla eAthena) --- src/gui/table.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/gui/table.cpp') diff --git a/src/gui/table.cpp b/src/gui/table.cpp index 89a93825..8d2ab86a 100644 --- a/src/gui/table.cpp +++ b/src/gui/table.cpp @@ -102,11 +102,14 @@ GuiTable::setModel(TableModel *new_model) mModel->removeListener(this); } + mModel = new_model; installActionListeners(); - new_model->installListener(this); - recomputeDimensions(); + if (new_model) { + new_model->installListener(this); + recomputeDimensions(); + } } @@ -187,6 +190,9 @@ GuiTable::uninstallActionListeners(void) void GuiTable::installActionListeners(void) { + if (!mModel) + return; + int rows = mModel->getRows(); int columns = mModel->getColumns(); @@ -367,7 +373,7 @@ GuiTable::getWidgetAt(int x, int y) if (row > -1 && column > -1) { gcn::Widget *w = mModel->getElementAt(row, column); - if (w->isFocusable()) + if (w && w->isFocusable()) return w; else return NULL; // Grab the event locally -- cgit v1.2.3-70-g09d2