From 09963adfe919180f5936d048b4ab7a057134a8ff Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 14 Apr 2014 02:01:01 +0300 Subject: Add quick fix for normal right click. --- src/gui/viewport.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 46d47ab4a..c7e2b31df 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -270,13 +270,12 @@ void Viewport::logic() BLOCK_START("Viewport::logic") // Make the player follow the mouse position // if the mouse is dragged elsewhere than in a window. - followMouse(); + Gui::getMouseState(&mMouseX, &mMouseY); BLOCK_END("Viewport::logic") } void Viewport::followMouse() { - return; if (!gui) return; const uint8_t button = Gui::getMouseState(&mMouseX, &mMouseY); -- cgit v1.2.3-70-g09d2 From 5b38e2f4601ecde262e7c0962a46b81e57889fe0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 17 Apr 2014 00:58:49 +0300 Subject: Add missing check in spellmanager. This fix crash in spells window if try drag empty cell. --- src/spellmanager.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index b1fad932a..cd4f0f2fd 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -399,6 +399,9 @@ void SpellManager::swap(const int id1, const int id2) { TextCommand *const spell1 = mSpells[id1]; TextCommand *const spell2 = mSpells[id2]; + if (!spell1 || !spell2) + return; + // swap in map mSpells[id1] = spell2; mSpells[id2] = spell1; -- cgit v1.2.3-70-g09d2 From ff6c93b16f408a2ef10e47a4168c59ab6c4fdafb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 19 Apr 2014 14:52:01 +0300 Subject: Fix compilation warnings. --- build/bmakedebug | 5 +++-- src/commands.cpp | 1 + src/commands.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/build/bmakedebug b/build/bmakedebug index 9d99e473d..8c3d43089 100755 --- a/build/bmakedebug +++ b/build/bmakedebug @@ -9,7 +9,7 @@ export CXX=g++-4.9 export LANG=C -export CXXFLAGS="-ggdb3 -Og -pipe -ffast-math \ +export CXXFLAGS="-ggdb3 -O2 -pipe -ffast-math \ -fsanitize=address \ -fno-omit-frame-pointer -funswitch-loops \ -Wvariadic-macros -Wvla -Wredundant-decls \ @@ -37,7 +37,8 @@ export CXXFLAGS="-ggdb3 -Og -pipe -ffast-math \ -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function \ -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -ftrapv \ -fsched-pressure \ --Wconditionally-supported -Wdate-time" +-Wconditionally-supported -Wdate-time \ +-fno-var-tracking" autoreconf -i ./configure --prefix=$dir/run \ diff --git a/src/commands.cpp b/src/commands.cpp index de4c03012..3d476f8c6 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -1136,6 +1136,7 @@ impHandler0(error) { const int *const ptr = nullptr; logger->log("test %d", *ptr); + exit(1); } impHandler(url) diff --git a/src/commands.h b/src/commands.h index 6dd688a17..a27f430db 100644 --- a/src/commands.h +++ b/src/commands.h @@ -107,7 +107,7 @@ namespace Commands decHandler(serverIgnoreAll); decHandler(serverUnIgnoreAll); decHandler(setDrop); - decHandler(error); + decHandler(error) __attribute__ ((noreturn)); decHandler(url); decHandler(open); decHandler(dump); -- cgit v1.2.3-70-g09d2 From bcd95847a435bb3aab90bdb3c2fdada6063efc2e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 22 Apr 2014 21:54:59 +0300 Subject: Fix crash if start trade with opened storage. --- src/gui/widgets/itemcontainer.cpp | 2 +- src/gui/widgets/itemcontainer.h | 3 +++ src/gui/windows/inventorywindow.cpp | 17 ++++++++++++++++- src/gui/windows/inventorywindow.h | 2 ++ src/net/ea/inventoryhandler.cpp | 11 +++++++++++ src/net/ea/inventoryhandler.h | 2 ++ src/net/inventoryhandler.h | 2 ++ 7 files changed, 37 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index ee2e35920..f24be7737 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -507,7 +507,7 @@ void ItemContainer::mouseReleased(MouseEvent &event) Net::getInventoryHandler()->moveItem(mSelectedIndex, index); selectNone(); } - else + else if (mInventory) { const DragDropSource src = dragDrop.getSource(); DragDropSource dst = DRAGDROP_SOURCE_EMPTY; diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index f7bc44849..06e9fd459 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -131,6 +131,9 @@ class ItemContainer final : public Widget, bool getClickCount() const A_WARN_UNUSED { return mClicks; } + void unsetInventory() + { mInventory = nullptr; } + private: enum Direction { diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index c2a4b4636..01e5e052d 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -271,7 +271,8 @@ void InventoryWindow::postInit() InventoryWindow::~InventoryWindow() { invInstances.remove(this); - mInventory->removeInventoyListener(this); + if (mInventory) + mInventory->removeInventoyListener(this); if (!invInstances.empty()) invInstances.front()->updateDropButton(); @@ -681,7 +682,10 @@ void InventoryWindow::close() else { if (Net::getInventoryHandler()) + { Net::getInventoryHandler()->closeStorage(Inventory::STORAGE); + Net::getInventoryHandler()->forgotStorage(); + } scheduleDelete(); } } @@ -806,3 +810,14 @@ void InventoryWindow::setVisible(bool visible) mSortDropDown->hideDrop(); Window::setVisible(visible); } + +void InventoryWindow::unsetInventory() +{ + if (mInventory) + { + mInventory->removeInventoyListener(this); + if (mItems) + mItems->unsetInventory(); + } + mInventory = nullptr; +} diff --git a/src/gui/windows/inventorywindow.h b/src/gui/windows/inventorywindow.h index 7e47e0362..10e1e21e2 100644 --- a/src/gui/windows/inventorywindow.h +++ b/src/gui/windows/inventorywindow.h @@ -152,6 +152,8 @@ class InventoryWindow final : public Window, void setVisible(bool visible) override final; + void unsetInventory(); + static bool isAnyInputFocused(); private: diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index f3c8040e1..ea7390ccb 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -486,6 +486,11 @@ void InventoryHandler::processPlayerStorageClose(Net::MessageIn &msg A_UNUSED) { // Storage access has been closed // Storage window deletes itself + if (mStorageWindow) + { + mStorageWindow->unsetInventory(); + mStorageWindow->close(); + } mStorageWindow = nullptr; if (mStorage) @@ -592,9 +597,15 @@ void InventoryHandler::closeStorage() { if (mStorageWindow) { + mStorageWindow->unsetInventory(); mStorageWindow->close(); mStorageWindow = nullptr; } } +void InventoryHandler::forgotStorage() +{ + mStorageWindow = nullptr; +} + } // namespace Ea diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index ac88c1d6c..4546b75bb 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -210,6 +210,8 @@ class InventoryHandler : public Net::InventoryHandler void closeStorage() override final; + void forgotStorage() override final; + Inventory *getStorage() const { return mStorage; } diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index 53e7d15b1..42649bae6 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -71,6 +71,8 @@ class InventoryHandler virtual void closeStorage() = 0; + virtual void forgotStorage() = 0; + virtual int convertFromServerSlot(const int eAthenaSlot) const = 0; }; -- cgit v1.2.3-70-g09d2 From 1c7d1e52decce816a0da17234386f77e7693f0b7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 23 Apr 2014 00:39:35 +0300 Subject: Fix links removing from over head text. --- src/being/being.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/being/being.cpp b/src/being/being.cpp index 621b61d02..683bfb6f5 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -441,7 +441,7 @@ void Being::setSpeech(const std::string &text, const std::string &channel, mSpeech.erase(e, 1); mSpeech.erase(start, (position - start) + 1); } - position = mSpeech.find('@'); + position = mSpeech.find("@@"); while (position != std::string::npos) { -- cgit v1.2.3-70-g09d2 From 52a8b304302afd9a98274518d75b971441d7dda9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 23 Apr 2014 20:25:10 +0300 Subject: Dont check required field for enable/disable music files downloading. --- src/gui/windows/updaterwindow.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 824d8e0f6..75460cf78 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -840,21 +840,11 @@ void UpdaterWindow::logic() if (mUpdateIndex < mUpdateFiles.size()) { UpdateFile thisFile = mUpdateFiles[mUpdateIndex]; - if (!thisFile.required) + if (thisFile.type == "music" + && !config.getBoolValue("download-music")) { - // This statement checks to see if the file type - // is music, and if download-music is true - // If it fails, this statement returns true, - // and results in not downloading the file - // Else it will ignore the break, - // and download the file. - - if (!(thisFile.type == "music" - && config.getBoolValue("download-music"))) - { - mUpdateIndex++; - break; - } + mUpdateIndex++; + break; } mCurrentFile = thisFile.name; std::string checksum; -- cgit v1.2.3-70-g09d2 From 3e9346b5bae797139e6e992162a584ba5a4b0e8b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 26 Apr 2014 11:59:47 +0300 Subject: Change version to 1.4.4.26. --- ChangeLog | 6 ++++++ README | 2 +- README.txt | 2 +- build/packevol | 2 +- build/packtmw | 2 +- build/packwin | 2 +- configure.ac | 2 +- src/main.h | 4 ++-- 8 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 18e91f09f..df2dfd29a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-04-26 New release 1.4.4.26 +fix: crash with dragging empty spell. +fix: crash if open storage and start trade. +fix: links drawing over player head. +fix: downlod music option with incomplete configuration. + 2014-04-12 New release 1.4.4.12 fix: possible crash. fix: selection in dropdowns. diff --git a/README b/README index 4b189d02e..0df38ec58 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ THE MANA PLUS CLIENT =============== - Version: 1.4.4.12 Date: 2014-04-12 + Version: 1.4.4.26 Date: 2014-04-26 Development team: - See AUTHORS file for a list diff --git a/README.txt b/README.txt index b3529373f..0b5162e55 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ THE MANA PLUS CLIENT =============== - Version: 1.4.4.12 Date: 2014-04-12 + Version: 1.4.4.26 Date: 2014-04-26 Development team: - See AUTHORS file for a list diff --git a/build/packevol b/build/packevol index 60a4363cb..6f5460d33 100755 --- a/build/packevol +++ b/build/packevol @@ -7,7 +7,7 @@ dir=`pwd` cd packaging/windows ./make-translations.sh makensis -DDLLDIR=$dir/../libs/dll/ \ - -DPRODUCT_VERSION="1.4.4.12" \ + -DPRODUCT_VERSION="1.4.4.26" \ -DEXESUFFIX=/src \ -DUPX=true \ evol.nsi diff --git a/build/packtmw b/build/packtmw index c6c04f06c..2163d7a41 100755 --- a/build/packtmw +++ b/build/packtmw @@ -7,7 +7,7 @@ dir=`pwd` cd packaging/windows ./make-translations.sh makensis -DDLLDIR=$dir/../libs/dll/ \ - -DPRODUCT_VERSION="1.4.4.12" \ + -DPRODUCT_VERSION="1.4.4.26" \ -DEXESUFFIX=/src \ -DUPX=true \ tmw.nsi diff --git a/build/packwin b/build/packwin index 10961c2de..9e647ba64 100755 --- a/build/packwin +++ b/build/packwin @@ -7,7 +7,7 @@ dir=`pwd` cd packaging/windows ./make-translations.sh makensis -DDLLDIR=$dir/../libs/dll/ \ - -DPRODUCT_VERSION="1.4.4.12" \ + -DPRODUCT_VERSION="1.4.4.26" \ -DEXESUFFIX=/src \ -DUPX=true \ setup.nsi diff --git a/configure.ac b/configure.ac index d066deb51..baf164eae 100755 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT([ManaPlus], [1.4.4.12], [akaras@inbox.ru], [manaplus]) +AC_INIT([ManaPlus], [1.4.4.26], [akaras@inbox.ru], [manaplus]) AM_INIT_AUTOMAKE([1.9]) AC_CONFIG_HEADERS([config.h:config.h.in]) AC_LANG_CPLUSPLUS diff --git a/src/main.h b/src/main.h index 5c47e72ac..047b9c9a2 100644 --- a/src/main.h +++ b/src/main.h @@ -45,8 +45,8 @@ * different interfaces, which have different implementations for each server. */ -#define SMALL_VERSION "1.4.4.12" -#define CHECK_VERSION "01.04.04.12" +#define SMALL_VERSION "1.4.4.26" +#define CHECK_VERSION "01.04.04.26" #ifdef HAVE_CONFIG_H #include "../config.h" -- cgit v1.2.3-70-g09d2