From 067ad70e9978fd678bb784783b2b5c3dc32746d1 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Tue, 7 Aug 2012 12:27:41 +0200 Subject: Fixed special keeping in list after serverside remove MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Thorbjørn Lindeijer. --- src/net/manaserv/playerhandler.cpp | 1 + src/playerinfo.cpp | 5 +++++ src/playerinfo.h | 5 +++++ 3 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp index c2c491d5..484e551a 100644 --- a/src/net/manaserv/playerhandler.cpp +++ b/src/net/manaserv/playerhandler.cpp @@ -248,6 +248,7 @@ void PlayerHandler::handleMessage(MessageIn &msg) case GPMSG_SPECIAL_STATUS : { + PlayerInfo::clearSpecialStatus(); while (msg.getUnreadLength()) { // { B specialID, L current, L max, L recharge } diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp index 692090af..03c48340 100644 --- a/src/playerinfo.cpp +++ b/src/playerinfo.cpp @@ -282,6 +282,11 @@ void setBuySellState(BuySellState buySellState) // --- Specials --------------------------------------------------------------- +void clearSpecialStatus() +{ + mSpecials.clear(); +} + void setSpecialStatus(int id, int current, int max, int recharge) { logger->log("SpecialUpdate Skill #%d -- (%d/%d) -> %d", id, current, max, diff --git a/src/playerinfo.h b/src/playerinfo.h index d7483cc1..e228ec7e 100644 --- a/src/playerinfo.h +++ b/src/playerinfo.h @@ -224,6 +224,11 @@ namespace PlayerInfo // --- Specials --------------------------------------------------------------- + /** + * Removes all specials. + */ + void clearSpecialStatus(); + /** * Changes the status of the given special. */ -- cgit v1.2.3-70-g09d2