From 3e5205cda742c6042f4df2d12384f50f113bafb7 Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 1 Aug 2009 21:39:33 +0200 Subject: *Do not remove player reference to map on player remove from map. --HG-- branch : trunk --- src/game/Chat.cpp | 1 + src/game/Map.cpp | 4 +++- src/game/Player.cpp | 4 +--- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 323b4834a45..e6677070599 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -168,6 +168,7 @@ ChatCommand * ChatHandler::getCommandTable() { "entervehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugEnterVehicle, "", NULL }, { "uws", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateWorldStateCommand, "", NULL }, { "update", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateCommand, "", NULL }, + { "itemexpire", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 4f0ecb1d26a..f58086ccec6 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -818,10 +818,12 @@ void Map::Remove(Player *player, bool remove) // invalid coordinates player->RemoveFromWorld(); - player->ResetMap(); if( remove ) + { DeleteFromWorld(player); + player->ResetMap(); + } return; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6ede76af68e..6c52978fa42 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -481,9 +481,7 @@ Player::~Player () // it must be unloaded already in PlayerLogout and accessed only for loggined player //m_social = NULL; - // Remove reference to map if still exists - if (FindMap()) - ResetMap(); + assert (!FindMap()); // Note: buy back item already deleted from DB when player was saved for(uint8 i = 0; i < PLAYER_SLOTS_COUNT; ++i) -- cgit v1.2.3