From fa6d39d9f56e09abfb6b48bacdd66ddbad20c641 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Wed, 15 Jul 2009 22:37:35 +0200 Subject: Fixed compile warnings and crash in skill dialog The crash was probably due to roaming or uninitialized pointers in the skill map. Please remember to clear it after deleting its contents, and also remember that operator[] is non-const and will insert an element when it's not already there. The proper way to see if a map contains an element is by using find(). --- src/net/ea/specialhandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/net/ea/specialhandler.cpp') diff --git a/src/net/ea/specialhandler.cpp b/src/net/ea/specialhandler.cpp index 218ff795..528f531e 100644 --- a/src/net/ea/specialhandler.cpp +++ b/src/net/ea/specialhandler.cpp @@ -100,8 +100,8 @@ void SpecialHandler::handleMessage(MessageIn &msg) msg.readInt16(); // target type msg.skip(2); // unused int level = msg.readInt16(); - int sp = msg.readInt16(); - int range = msg.readInt16(); + msg.readInt16(); // sp + msg.readInt16(); // range msg.skip(24); // unused int up = msg.readInt8(); @@ -115,8 +115,8 @@ void SpecialHandler::handleMessage(MessageIn &msg) { skillId = msg.readInt16(); int level = msg.readInt16(); - int sp = msg.readInt16(); - int range = msg.readInt16(); + msg.readInt16(); // sp + msg.readInt16(); // range int up = msg.readInt8(); player_node->setAttributeBase(skillId, level); -- cgit v1.2.3-70-g09d2