summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-19 22:38:59 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-19 23:37:36 +0100
commit363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe (patch)
tree117ce95d3587f913a64b71fe4dcdee716b8aea7e /src/localplayer.cpp
parent432d16435774cafd630e287321e882f3e8510d16 (diff)
downloadmana-client-363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe.tar.gz
mana-client-363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe.tar.bz2
mana-client-363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe.tar.xz
mana-client-363527d0f95963ba3f4a6d25c8eabc1bb3ad4efe.zip
Fixed a crash when trying to switch servers
Ownership of the charInfo global variable wasn't well defined. It was being locked, unlocked and generally modified from a lot of places, and somewhere in this mess it ended up crashing when switching servers. Now the CharHandler instances, for eAthena and manaserv respectively, own this list of characters. A new class, Net::Character wraps up the slot index in combination with the player dummy. The list is passed on to the CharSelectDialog each time it changes. Both related and unrelated cleanups were made as well. Reviewed-by: Jared Adams
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 4e70fc2f..30159f34 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -74,8 +74,8 @@ const short walkingKeyboardDelay = 1000;
LocalPlayer *player_node = NULL;
-LocalPlayer::LocalPlayer(int id, int job, Map *map):
- Player(id, job, map),
+LocalPlayer::LocalPlayer(int id, int job):
+ Player(id, job, 0),
mEquipment(new Equipment),
mInStorage(false),
mAttackRange(0),
@@ -795,7 +795,7 @@ void LocalPlayer::stopAttack()
mLastTarget = -1;
}
-void LocalPlayer::raiseAttribute(size_t attr)
+void LocalPlayer::raiseAttribute(int attr)
{
// we assume that the server allows the change. When not we will undo it later.
mCharacterPoints--;
@@ -805,7 +805,7 @@ void LocalPlayer::raiseAttribute(size_t attr)
Net::getPlayerHandler()->increaseAttribute(attr);
}
-void LocalPlayer::lowerAttribute(size_t attr)
+void LocalPlayer::lowerAttribute(int attr)
{
// we assume that the server allows the change. When not we will undo it later.
mCorrectionPoints--;